commondream/tconsole — Issue #55: Support custom rake tasks
Author: cameel
Created: 2012-03-02 16:16:25+00:00
State: open

I'm using [Apotomo](https://github.com/apotonick/apotomo) and [Cells](https://github.com/apotonick/cells) in my application. Those two provide `test:widgets` and `test:cells` rake tasks for running tests. I also have `test:lib` task that runs tests for generic code that I usually put into lib/ directory. It would be nice if I could run those from tconsole and if `all` was taking them into account.

In my Rakefile I have this bit that makes `rake test` run everything:

``` ruby
Rake::Task[:test].enhance { Rake::Task["test:lib"].invoke() }
Rake::Task[:test].enhance { Rake::Task["test:cells"].invoke() }
Rake::Task[:test].enhance { Rake::Task["test:widgets"].invoke() }
```

Not perfect (does not run the additional tests when `rake test` fails) but does the job fine. I'm not sure how I could achieve this in tconsole.

I see three ways of implementing this (fom the UI standpoint):
1) Allow one to define names of custom tasks in the config
2) When you give a directory, execute all tests (ending in `_test.rb`) in that directory. Then `test` would run all tests, `test/widgets` would run all tests for widgets (located in `test/widgets`), etc.
3) Add `rake` command to run arbitrary rake task from within tconsole