【发布时间】:2013-12-17 15:49:17
【问题描述】:
在 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 runner 和 Turn runner 对此进行了测试。两者都表现出这种行为。
MiniTest 在运行rake test 而不是rake test:all 时是否有意将测试分成批次?
我做了一个bundle update,我的所有测试 gem 都没有版本限制,所以我相信一切都是最新的。宝石版本:
- Rails 4.0.2
- MiniTest 4.7.5
- MiniTest Rails 0.9.2
【问题讨论】:
-
这很奇怪!套件中的文件是否始终相同?