Rails console and rake test: units

I was wondering if I can run my tests in the rails console instead of the command line. In fact, for this it follows that rake test: units on the command line take a long time to load the rails environment. So I thought: why not start the console to load the environment once, and then continue working with the rake block: it checks every time I want to check my code. In the end, the rails must be flexible and foster agile development. So I tried this. First of all, I had to say:

Rake required

but even after that I got an error message:

irb(main):002:0> Rake::Task['test.units'].invoke
RuntimeError: Don't know how to build task 'test.units'

I think I need to somehow say where to look. Any thoughts?

thank

Chris

+5
2
ruby-1.9.2-p290 :001 > require 'rake'
ruby-1.9.2-p290 :002 > r = Rake.application
ruby-1.9.2-p290 :003 > r.init
ruby-1.9.2-p290 :004 > r.load_rakefile
ruby-1.9.2-p290 :005 > r['test:units'].invoke
+5

Spork , .

0

All Articles