I was wondering whether I could run my tests under rails console rather than the command line. Actually the rationale for this is that rake test:units on the command line takes ages to load the rails environment. So I thought, why not start a console to load the environment once and then keep running rake unit:tests each time I wanted to check my code. After all, rails is meant to be agile and promote agile development. So I tried this. First of all I had to say:
require 'Rake'
but even after doing that I got the error message:
irb(main):002:0> Rake::Task['test.units'].invoke
RuntimeError: Don't know how to build task 'test.units'
I guess I need to somehow tell it where to look. Any thoughts?
Thanks
Chris
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With