Run a single test in Test::Unit

Updated . Posted . Visible to the public.

To run a single test file:

rake test:units TEST=test/unit/post_test.rb
rake test:functionals TEST=test/functional/posts_controller_test.rb
rake test:integration TEST=test/integration/admin_news_posts_test.rb

You may even run a single test method:

ruby -I test test/unit/post_test.rb -n "name of the test"
ruby -I test test/functional/posts_controller_test.rb -n test_name_of_the_test # underscored, prefixed with 'test_'

Or all tests matching a regular expression:

ruby -I test test/integration/admin_news_posts_test.rb -n "/matching string/"
Profile picture of Henning Koch
Henning Koch
Last edit
Dominik Schöler
License
Source code in this card is licensed under the MIT License.
Posted by Henning Koch to makandra dev (2010-08-25 12:16)