Part 5RSpec Mocks

A robust test suite will run fast, be deterministic, and cover all essential code paths. Unfortunately, dependencies often get in the way of these goals. Sometimes, we can’t reliably test code while it’s integrated with other libraries or systems.

In this part of the book, we’re going to talk about test doubles, including mock objects. These allow you to tightly control the environment in which your tests run. The result will be faster, more reliable specs.

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.