Skip to content

Instantly share code, notes, and snippets.

@iamatypeofwalrus
Last active August 29, 2015 14:03
Show Gist options
  • Save iamatypeofwalrus/8967e890b9a49edec432 to your computer and use it in GitHub Desktop.
Save iamatypeofwalrus/8967e890b9a49edec432 to your computer and use it in GitHub Desktop.
Running Singles Files/Tests in Rails the Easy Way

Just one type of test

ruby test/functional/person_controller.rb

Specific test

ruby test/functional/person_controller.rb -n test_that_will_run

Use some basic regexp

ruby test/functional/person_controller.rb -n /that_one_end_point_name/

Note

Even if you dynamically generate tests, when ruby loads the test file it will be able to reference all tests. This means you can either call out any test by name or use some simple regex to run only a specific subset of tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment