I currently have some expectations set up on a mock with consecutive calls:
The spec:
@my_mock = mock("a_mock")
@options1 = {:some => "option"}
@options2 = {:some_other => "option"}
@first_param = mock("first_param")
@my_mock.should_receive(:a_message).with(@first_param, @options1)
@my_mock.should_receive(:a_message).with(@first_param, @options2)
However, i get the following:
Mock "a_mock" received :a_message with unexpected arguments
expected: (#<Spec::Mocks::Mock:0x81b8ca3c @name="first_param"{:some => "option"})
got: (#<Spec::Mocks::Mock:0x81b8ca3c @name="first_param">, {:some_other => "option"})
When I debug this, the first expectation IS getting called. Do I have to specify anything else before I can expect consecutive calls with the same message but differing parameters?