Running a specific test in a test file

I remember there was a way to run a specific test from a test file.

ruby test_file.rb

Runs the all the tests. How can I select one from this?

Also is there any complete reference on this (which argument the ruby
command takes when running test files)?

John

On Mon, Dec 15, 2008 at 7:40 AM, Hunt J. [email protected]
wrote:

Are you talking about a Ruby on Rails application? If so, try:

$ cd test
$ ruby unit/<>_test.rb

If you want to run a specific test (that you have defined, say in
mymodel.rb), you can run

$ ruby unit/mymodel.rb -n test_min_is_less_than_max

assuming you want to run the “min is less than max” text, also known as
“test_min_is_less_than_max”.

At least, that’s what works for me :slight_smile:

–wpd

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs