just in ram

A list of stuff I should remember but never do

Ruby unit testing – run only one test

with 4 comments

If you don’t wish to run all the unit tests in your test case you can tell ruby to run only one by passing in the name of the test:

  ruby test_mytestcase.rb --name test_just_this_method

Written by Justin Ramel

December 5th, 2006 at 12:25 pm

Posted in Ruby, Testing

4 Responses to 'Ruby unit testing – run only one test'

Subscribe to comments with RSS or TrackBack to 'Ruby unit testing – run only one test'.

  1. Hello justin!

    I’m new to this testing in ruby, can u plz tell me how to apply more than one test case at a time.Plz explain me with an example.

    Kumaran

    12 Sep 07 at 3:23 pm

  2. Kumaran, you can do this by putting a –name (or -n) in front of each test name:

    ruby test_mytestcase.rb -n test_1 -n test_2

    Hope that helps,
    -Matt

    Matt

    18 Sep 07 at 5:41 pm

  3. Note that each test must begin with the word test_xxx for it to run it.

    roger pack

    15 Nov 07 at 6:07 am

  4. Perfect was curious on how to properly test.

    hottiehair

    17 Apr 08 at 1:42 am

Leave a Reply