Using Parts of RSpec With Other Test Frameworks

Sometimes, you’ll want to use the powerful test doubles available in rspec-mocks, or the composable matchers provided by rspec-expectations, in a project where the rest of RSpec isn’t a good fit. For instance, you may already have an extensive test suite written in Minitest, or you may be writing acceptance tests in Cucumber.[124][125]

Both of these parts of RSpec are easy to use with other test frameworks, or even without a test framework at all. In fact, you’ve already done so in Parts of an Expectation and throughout Chapter 13, Understanding Test Doubles.

If you’re using Minitest, RSpec provides a couple of conveniences for you, including the following:

  • Reporting unmet expectations correctly ...

Get Effective Testing with RSpec 3 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.