Module: Stirlitz::Matchers

Defined in:
lib/stirlitz/matchers.rb

Defined Under Namespace

Classes: HaveReceived

Instance Method Summary collapse

Instance Method Details

#have_received(expected) ⇒ Object

:call-seq:

should have_received(expected_method)
should have_received(expected_method).with(args)
should_not have_received(expected)

Passes if actual had expected invoked on it. You can also pass args to verify that they were called with them

Examples

mock_object.should have_received(:save)
mock_object.should have_received(:update_attributes).with({:name => 'new name'})
mock_object.should_not have_received(:destroy)


16
17
18
# File 'lib/stirlitz/matchers.rb', line 16

def have_received(expected)
  HaveReceived.new(expected)
end