Primitive Matchers
The word primitive in a programming language refers to a bread-and-butter data type that can’t be broken down into smaller pieces. Booleans, integers, and floating-point numbers are all primitives.
RSpec’s primitive matchers are similar. They have simple, precise definitions that can’t be broken down any further. They’re not meant to accept other matchers as input (but you can go the other direction, passing them into other matchers). Typically, they just pass the operation you’re performing—an equality check, for example—straight through to the subject of the expectation.
Equality and Identity
RSpec’s most fundamental matchers are all concerned with variations of the question, “Are these two things the same?” Depending on ...
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.