无法测试我的模型测试

Cannot test my model tests

我在文件夹中有测试:

 test/models/person/helper/age_calculator_test.rb

这些测试应该失败,因为:

  assert_equal false, true

当我 运行:

他们确实失败了
bundle exec m test/models/person/helper/age_calculator_test.rb

但是当我运行宁:

bundle exec m test/models

这些测试不是运行!我哪里错了? 如何在一个命令中使用 Bundler 测试所有 Model-Test?谢谢!!

您似乎使用了Metal test runner。我在其支持路径测试的文档中看不到任何地方,例如 test/models。它的主要特点是 运行 按行号进行测试。

如果您想执行所有模型测试,您可以使用 Rails'

rake test:models

去做。有关更多选项,请参阅 Rake Tasks for Running your Tests 上的 RoR 指南。