RSpec / RSpec Mocks / Docs
Setting constraints
RSpec provides a fluent interface off of expect(...).to receive(...) that allows you to further constrain what you expect: the arguments, the number of times, and the ordering of multiple messages.
Although not shown here, this fluent interface is also supported by spies, off of have_received(...).
In this section
Source: features/setting_constraints/README.md at v3.0.4, RSpec Mocks (MIT license).