Rails rake command to run a single unit test

by admin on June 6, 2008

Q: What is the rake command to run a single rails unit test?

A: There is none, use ruby test/unit/my_test.rb

{ 2 comments… read them below or add one }

Chris 05.13.09 at 1:51 pm

Not true, to invoke the rails environment, use:
rake test TEST=/path/to/test (i.e. rake test TEST=test/unit/accounts.rb)

olivander 06.23.09 at 12:17 pm

in my rails 2.3.2 environment
rake test TEST=/path/to/test
runs the test three times

But
rake test:units TEST=/path/to/test
works fine.

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>