测试套件使用MiniTest分两批运行

时间:2013-12-17 15:49:18

标签: ruby-on-rails 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跑步者进行了测试。两者都表现出这种行为。

在运行rake test而不是rake test:all时,MiniTest是否有意将测试分成批次?

我做了bundle update,我的测试宝石都没有版本限制,所以我相信一切都是最新的。宝石版本:

  • Rails 4.0.2
  • MiniTest 4.7.5
  • MiniTest Rails 0.9.2

1 个答案:

答案 0 :(得分:1)

这是故意的,因为这是rails测试任务在rails 3.x中的工作方式。 minitest-rails库会覆盖任务并为您提供旧行为。即将发布的minitest-rails将会改变这一点并且类似于rails 4任务的工作。

相关问题