Contents

This page comes from RSpec Core 2.11.3. It is not part of the 3.12.1 docs. See the latest RSpec Core docs.

Argument matchers

Introduction

Argument matchers can be used:

If more control is needed, one can use a block

obj.should_receive(:message) do |arg1,  arg2|
  # set expectations about the args in this block
  # and optionally set a return value
end

Source: features/argument_matchers/README.md at v2.11.3, RSpec Core (MIT license).