let's say you added a controller and action (example: story/index
), and want to run a functional test by
rake test:functionals
and then you found that another part of the project your coworker is working on actually broke the test at an earlier place (another controller/action), before your functional test takes place.
In this case, can you run just one functional test, which is yours?
Wise-Ass Answer
If you coworker breaks the tests, then he should fix the test, or he shouldn't have committed the code to the repo. That is the main principle that we usually have in projects I work on.
Nice Answer
Try this
rake test:functionals TEST=test/functional/xy_test.rb
Or this
running one test without rake but with explicit $-loadpath works too
here "ruby -I directory" specifies the $loadpath. Otherwise you won't load test environment and "require test_helper" fails!
ruby -I test test/functional/xy_test.rb
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