views:

563

answers:

3

As title.

ruby test/functionals/whatevertest.rb doesn't work, that requires me to replace all require 'test_helper' to require File.dirname(__FILE__) + '/../test_helper'. For some reason most of those test templates have such issue, so I rather to see if there is a hack I could get around it.

+3  A: 

On Linux? why not try (cd test && ruby functionals/whatevertest.rb). Note, the parentheses are important as otherwise your current directory will change to the subdirectory. What it does is fork another shell, change to the subdirectory in it, and run the test.

tvanfosson
goodwill
Updated with your fix.
tvanfosson
+5  A: 

Try this:

ruby -Ilib:test test/functionals/whatevertest.rb

I actually run it with:ruby -I test test/functional/whatevertest.rbbut it ends up being the same thing.
Daemin
A: 

The answer for the title question would be:

ruby unit/post_test.rb -n selected_test # use to run only one selected test

but for the body of the question tvanfosson gave a good answer.

Jeznet