We’ve covered a lot of ground this chapter! From basic Ruby building blocks like strings and numbers, through deeply nested collections, to methods with side effects, you can find a matcher to suit your needs.
All these matchers built into RSpec are designed to help you do two things:
Express exactly how you want the code to behave, without being too strict or too lax
Get precise feedback when something breaks so that you can find exactly where the failure happened
It’s much more important to keep these two principles in mind than it is to memorize all the different matchers. As you try your hand at the following exercises, refer to Appendix 3, Matcher Cheat Sheet to get inspiration for different matchers to try.
Since matchers ...