Contents

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(...).

Source: features/setting_constraints/README.md at v3.5.0, RSpec Mocks (MIT license).