Running a specific test in a test file.

H

Hunt Jon

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
 
P

Patrick Doyle

[Note: parts of this message were removed to make it a legal post.]

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

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

$ cd test
$ ruby unit/<<name of model>>_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 :)

--wpd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top