[英]Test suite runs in two batches with MiniTest
在Rails 4.0.2應用程序中,使用MiniTest運行rake test
時,測試將批量運行,而不是報告所有測試的合計通過/失敗次數。 也就是說,模型測試以一批運行,而集成測試則以另一批運行。 我從一次rake test
調用中得到的輸出如下所示:
Loaded Suite test,test/integration,test/models
# All the model tests run and print their output here
18 tests, 18 passed, 0 failures, 0 errors, 1 skips, 40 assertions
Loaded Suite test,test/integration,test/models
# All the integration tests run and print their output here
5 tests, 5 passed, 0 failures, 0 errors, 0 skips, 24 assertions
當我運行rake test:all
時, 不會發生這種情況。 我使用內置的MiniTest運行器和Turn運行器進行了測試。 兩者都表現出這種行為。
MiniTest是否有意在運行rake test
而不是rake test:all
時將測試分為幾批?
我進行了bundle update
,並且我的測試gem都沒有版本限制,因此我相信一切都是最新的。 寶石版本:
這是有意的,因為這是Rails測試任務在Rails 3.x中的工作方式。 minitest-rails庫將覆蓋任務,並為您提供舊的行為。 minitest-rails即將發布的版本將對此進行更改,其工作原理類似於rails 4任務的工作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.