2013-12-17 25 views
1

在Rails 4.0.2應用程序中,當使用MiniTest運行rake test時,測試將分批運行,而不是報告所有測試的合計通過/失敗編號。也就是說,模型測試作爲一個批次運行,集成測試作爲另一個批處理運行。從rake test一個調用我的輸出是這樣的:測試套件使用MiniTest分兩批運行

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跑步者和轉身跑步者進行了測試。都表現出這種行爲。

是否故意MiniTest在運行時將測試劃分爲批次rake test而不是rake test:all

我做了一個bundle update,我的測試寶石都沒有版本限制,所以我相信一切都是最新的。寶石版本:

  • 的Rails 4.0.2
  • MINITEST 4.7.5
  • MINITEST的Rails 0.9.2
+0

這很奇怪!套件中的文件總是一樣的嗎? – phoet

回答

1

這是故意的,這是軌測試任務在軌3是如何工作的。X。 minitest-rails庫會覆蓋任務併爲您提供舊的行爲。即將發佈的minitest-rails將會改變這種情況,並且類似於rails 4的任務工作。

+0

謝謝!這是一個非常簡單的答案。 – rlkw1024