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

We cover:

  • A tour of the included matchers
  • The difference between primitive and higher-order matchers
  • The difference between value and block expectations

Chapter 11Matchers Included in RSpec Expectations

In the previous chapter, you learned how to write expectations to check your code’s behavior. You got to know the various parts of an expectation, such as the subject and the matcher.

Now, it’s time to take a closer look at matchers. You’ve called them in your specs and combined them with other matchers. You’ve even written a simple one from scratch, though most of the time you won’t have to. RSpec ships with a ton of useful matchers to help you specify exactly how you want your code to behave.

In this chapter, we’re going to take a tour of RSpec’s ...

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