Method: RSpec::Mocks::ExampleMethods#expect

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

#expectObject

Note:

This method is usually provided by rspec-expectations. However, if you use rspec-mocks without rspec-expectations, there's a definition of it that is made available here. If you disable the :expect syntax this method will be undefined.

Used to wrap an object in preparation for setting a mock expectation on it.

Examples:

expect(obj).to receive(:foo).with(5).and_return(:return_value)


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