Patrick Doyle
12/15/2008 1:39:00 PM
[Note: parts of this message were removed to make it a legal post.]
On Mon, Dec 15, 2008 at 7:40 AM, Hunt Jon <jona.hunt777@gmail.com> wrote:
> 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