Reputation: 478
what is the difference between using Minitest::Spec
and ActiveSupport::TestCase
in my test_helper
in Rails 4?
Upvotes: 2
Views: 1346
Reputation: 426
I've never actually used anything besides rspec, but according to their public APIs, ActiveSupport::TestCase only supports testing if an error was raised, while Minitest::Spec has a bit more support for testing things other than succesful DB queries.
Upvotes: 0
Reputation: 357
This project aims to enable MiniTest within the Rails TestCase classes. Your test will continue to inherit from
ActiveSupport::TestCase
, which will now support the spec DSL. Minitest on Github
This means you don't have to use Minitest::Spec
and can simply use ActiveSupport::TestCase
all the time to get some convention in your code.
Edit: When you don't use minitest-rails gem you have to register_spec_type
class ControllerSpec < MiniTest::Spec
end
# Functional tests = describe ***Controller
MiniTest::Spec.register_spec_type( /Controller$/, ControllerSpec )
Upvotes: 3