O'Reilly logo

Effective Testing with RSpec 3 by Myron Marston, Ian Dees

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Part 4RSpec Expectations

With rspec-expectations, you can easily express expected outcomes about your code. While the syntax might initially look odd or even “magical,” under the covers it uses simple matcher objects that can be composed in useful, powerful ways.

In this section, we’ll dig into how rspec-expectations works, how to compose matchers, and why doing so is useful. We’ll take a tour of the matchers included in RSpec and then show you how to create your own domain-specific matchers for your projects.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required