2

I see that minitest is now included in Ruby, just require the file. Replaces unittest.

I'm still using rspec everywhere 'cos I came from Ruby on Rails.
minitest looks just like rspec witht the describes and its and befores.
I was thinking about switching from rspec to minitest to reduce the dependencies for my project (or at least see if they seem to be reduced after bundling).

Of course the asserts look a little different but essential are the same set of equality, member, etc. validations.

What advantages or disadvantages might exist for this sort of conversion?
Would I see be able to use the Capybara gem ok?

1 Answer 1

2

Minitest and Rspec are very similar. You are likely to miss the Rspec matchers, however there is an Rspec matchers gem for minitest. If you use it, there is a good chance your test will 'just work'.

Minitest integration

rspec-expectations is a stand-alone gem that can be used without the rest of RSpec. If you like minitest as your test runner, but prefer RSpec's approach to expressing expectations, you can have both.

To integrate rspec-expectations with minitest, add this:

require rspec/expectations/minitest_integration

More on matchers at
https://relishapp.com/rspec/rspec-expectations/docs/test-frameworks/minitest-integration

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.