我在文件夹中有测试:
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 指南更多选项。
关于ruby - 无法测试我的模型测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30299178/