A more concise way to call single test file in ruby
Sunday, April 25th, 2010I’ve been working with Rails and Ruby since 2006 and I’m surprised I hadn’t put this together for myself:
$ cd test # from your rails app root $ ruby unit/a_model_test.rb
As compared to:
$ ruby -I"lib:test" "/usr/local/Cellar/ruby-enterprise-edition/1.8.7-20090928/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/unit/a_model_test.rb"
Definitely a hand to forehead moment when I read that! Found it in a comment here:
https://rails.lighthouseapp.com/projects/16213/tickets/8
*Assumes your ruby command is set up correctly in your shell’s environment, of course.

