简体   繁体   中英

ruby Test::Unit Command line options?

When running tests in Ruby's unit::test framework, is there a really easy way to specify, from the command-line, that only one test should be run (that is, specify the test class and test member variable)? If not, is there another framework that has this feature?

ruby /path/to/foo_test.rb --name test_should_do_something_really_spiffy

That will call the test defined by the method test_should_do_something_really_spiffy in that file.

EDIT: That's for the Test::Unit framework that most ruby tests are written with. I am assuming you meant the same.

If you have the full Test::Unit framework, you can do

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

to get the command line options. I don't think it works if you just have the minitest version though.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM