Running unit test directly through command line in Rails 2

Testing out some mail receiving stuff, and ran into a problem with just running the script using:

ruby test/unit/mail_receive_test.rb

test/unit/mail_receive_test.rb:1:in `require': no such file to load -- test_helper (LoadError)
    from test/unit/mai_receive_test.rb:1

This was because I was not specifying the test directory in the load path, so simply pass in the test directory with the -I flag, and you'll be golden

ruby -Itest test/unit/mail_receive_test.rb

This was all run while in the rails root directory.

Posted
Views
Filed under: