Method: RSpec::Mocks::ExampleMethods#receive

Defined in:
lib/rspec/mocks/example_methods.rb

#receiveObject

Note:

If you disable the :expect syntax this method will be undefined.

Used to specify a message that you expect or allow an object to receive. The object returned by receive supports the same fluent interface that should_receive and stub have always supported, allowing you to constrain the arguments or number of times, and configure how the object should respond to the message.

Examples:

expect(obj).to receive(:hello).with("world").exactly(3).times


# File 'lib/rspec/mocks/example_methods.rb', line 336