How to output names of ruby unit tests

后端 未结 3 2121
我寻月下人不归
我寻月下人不归 2020-12-29 10:27

I have a unit test (example is modified Test::Unit documentation)

require \'test/unit\'

class TC_MyTest < Test::Unit::TestCase
  def test_something
    a         


        
3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-29 11:11

    Command line options do not work if you are creating your own test runner:

    Test::Unit::UI::Console::TestRunner.run(TC_MyTest)
    

    You will have to specify verbosity in test runner. Test::Unit::UI options are:

    SILENT = 0, PROGRESS_ONLY = 1, NORMAL = 2, VERBOSE = 3.

    So, for verbose:

    Test::Unit::UI::Console::TestRunner.run(TC_MyTest, 3)
    

提交回复
热议问题