[rspec-users] checking order of method calls on different mocks

Fregas fregas at gmail.com
Wed Jan 26 11:07:31 EST 2011


I have a spec where I need to check that the order of 2 method calls
to 2 different mocks is correct:

mock_customer.should_receive(:save).ordered
mock_customer.should_recieve(:id).and_return(1).ordered
mock_order.should_receive(:customer_id=).with(1).ordered

however this does not work.  I can set order.customer_id at the
beginning, before save and id are called and the spec passes.



More information about the rspec-users mailing list