2014-02-14 39 views

回答

2

该项目旨在在Rails TestCase 类中启用MiniTest。您的测试将继续从 ActiveSupport::TestCase继承,它现在将支持spec DSL。 Minitest on Github

这意味着你不必使用Minitest::Spec并且可以简单地使用ActiveSupport::TestCase所有的时间来得到你的代码中的一些约定。

编辑:当你不使用MINITEST护栏宝石,你必须register_spec_type

class ControllerSpec < MiniTest::Spec                                     
end                                             

# Functional tests = describe ***Controller                                   
MiniTest::Spec.register_spec_type(/Controller$/, ControllerSpec) 
0

我从来没有实际使用RSpec的之外任何东西,而是根据他们的公共API,ActiveSupport::TestCase只支持测试如果错误被提出,而Minitest::Spec对测试除了成功的数据库查询之外的东西有更多的支持。