Skip to content

Instantly share code, notes, and snippets.

@Martin91
Last active January 1, 2016 00:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Martin91/8065063 to your computer and use it in GitHub Desktop.
Save Martin91/8065063 to your computer and use it in GitHub Desktop.
Run single test example or test case with Rake task or ruby command line
# In Rails 3.2.x
# You can run a single test based on a file like:
rake test TEST=test/functionals/xxx_controller_test.rb
# Or even a single test example like:
ruby -I 'lib:test' test/functionals/xxx_controller_test.rb -n test_edit_profile_without_login
# In Rails 4.x.x
# You can run a single test based on a file like:
rake test /test/functionals/xxx_controller_test.rb # Notice: We don't need TEST system variable any more!
# Or even a single test example like:
rake test /test/functionals/xxx_controller_test.rb test_edit_profile_without_login # Notice: We can run a rake task directly instead of ruby command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment