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

wrote this post.

{ 2 comments… read them below or add one }

Chris May 13, 2009 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 June 23, 2009 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