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

Appendix 3Matcher Cheat Sheet

In Chapter 11, Matchers Included in RSpec Expectations, we went through the most commonly used matchers included in RSpec. Now, we’d like to show you all the matchers built-in to RSpec as of version 3.6 in a single reference that you can keep handy while you’re writing specs.

The Passes if… column provides an expression for each matcher that’s equivalent to what the matcher checks. The snippet isn’t necessarily how the matcher is implemented internally, as we’ve glossed over a few edge cases that don’t arise during daily use. If you’re curious about these implementation details, you can check out the source code.[134]

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