Ruby Test :: Unit Command Line Options?

When running tests in the Ruby unit :: test framework, is there really a simple way to indicate from the command line that only one test should be run (i.e. specify the test class and the test test variable)? If not, is there another structure that has this feature?

+7
ruby unit-testing testunit
source share
2 answers
ruby /path/to/foo_test.rb --name test_should_do_something_really_spiffy 

This will call the test defined by the test_should_do_something_really_spiffy method in this file.

EDIT: for the Test::Unit framework, with which most ruby ​​tests are written. I suppose you mean the same thing.

+6
source share

If you have a complete Test::Unit structure, you can do

 ruby /path/to/foo_test.rb --help 

to get command line options. I don't think this works if you only have a mini version.

+5
source share

All Articles