Running one test with test/unit

Hi,

As per this page[1], it is possible to run one test from a testcase by using..

# ruby [programfile] -n [testmethod]

I'm probably missing something obvious but I really don't know why it works. Can anyone shed some light?

Cheers,

Chris

[1] http://wiki.rubyonrails.com/rails/pages/HowtoRunOneTest

Chris Roos <chris@seagul.co.uk> writes:

Hi,

As per this page[1], it is possible to run one test from a testcase by
using..

# ruby [programfile] -n [testmethod]

I'm probably missing something obvious but I really don't know why it
works. Can anyone shed some light?

test/unit simply parses ARGV.

#604<2|>lilith:~/projects/rightyear# ruby test_rightyear.rb --help
Test::Unit automatic runner.
Usage: test_rightyear.rb [options] [-- untouched arguments]
...
    -n, --name=NAME Runs tests matching NAME.
                                     (patterns may be used).
...

ยทยทยท

Cheers,
Chris

--
Christian Neukirchen <chneukirchen@gmail.com> http://chneukirchen.org

Christian Neukirchen wrote:

Chris Roos <chris@seagul.co.uk> writes:

Hi,

As per this page[1], it is possible to run one test from a testcase by
using..

# ruby [programfile] -n [testmethod]

I'm probably missing something obvious but I really don't know why it
works. Can anyone shed some light?

test/unit simply parses ARGV.

#604<2|>lilith:~/projects/rightyear# ruby test_rightyear.rb --help
Test::Unit automatic runner.
Usage: test_rightyear.rb [options] [-- untouched arguments]
...
    -n, --name=NAME Runs tests matching NAME.
                                     (patterns may be used).
...

Indeed I was missing something obvious. Thanks for the pointer.

Chris