Yes I know the same question has been asked (How to run a single test from a rails test suite?), but the solution doesn't seem to work for Rails 3. Maybe it works for Rails 2?
How to run a single test in Rails 3.0.7 using Unit::Test? Not a single test file, but a single test.
test "the truth" do
assert false
end
ruby -I test test/functional/test_file.rb -n "the truth"
generates 0 tests, 0 assertions, 0 failures, 0 errors
Try Regular Expressions
bundle exec ruby -I test test/functional/test_file.rb -n "/truth/"
The "ruby -I (...) -n" method only works for me in Rails 3 like this:
bundle exec ruby -I test test/functional/test_file.rb -n "the truth"
But then again, I'm using jRuby so YMMV
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