There are several ways to run specific tests. If you want to run one test file, you can use the rake task and specify the file using the TEST environment variable: (You will need to install 0.5.2 to get this to work.)
$ rake test TEST=test/models/widget_test.rb
Or, if you want to avoid the test preparation that the rake tasks perform, you can call the file directly:
$ ruby -Ilib:test test/models/widget_test.rb
If you want to run just one test method, you have to call the file directly:
def test_refresh
# Do some testing here
end
$ ruby -Ilib:test test/models/widget_test.rb -n test_refresh
If your test is using the spec DSL, you need to find the name of the generated test method and call that:
it 'refreshes' do
# Do some testing here
end
$ ruby -Ilib:test test/models/widget_test.rb -n test_0003_refreshes