2012-01-27 40 views
1

我可以從多個腳本運行多個測試用例,但有單一輸出或者說「100%Pass」或「X Failed」,並列出失敗的測試?紅寶石測試單元:多個腳本,一個輸出

例如,我想看到的東西,如:

>runtests.rb all #runs all the scripts in the directory 
Finished in 4.523 Seconds 
100% Pass 

>runtests.rb category #runs all the scripts in a specified sub-directory 
Finished in 2.1 Seconds 
2 Failed: 
test_my_test 
test_my_test_2 
1 Error: 
test_my_test_3 

回答

2

我用的是內置與autotest命令是ZenTest一部分沿着MiniTest::Unit,並得到輸出,如:

autotest 
/Users/tinman/.rvm/rubies/ruby-1.9.2-p290/bin/ruby -I.:lib:test -rubygems -e "%w[test/unit tests/test_domains.rb tests/test_regex.rb tests/test_vlan.rb tests/test_nexus.rb tests/test_switch.rb tests/test_template.rb].each { |f| require f }" 
Loaded suite -e 
Started 
........................................ 
Finished in 0.143375 seconds. 

40 tests, 276 assertions, 0 failures, 0 errors, 0 skips 

Test run options: --seed 62474 

是類似於你在說什麼?