In my case I need to specify this behaviour. (I'm making sure the logging
happens in the right order).

I believe it really is a bug, so I have forked rspec (on github), written a
failing test and fixed my version of rspec to handle this case.

My version now matches against unsatisfied expectations in preference to
satisfied ones.

I'm not sure what the next step is in contributing a patch back..I guess I
raise a ticket in lighthouse.

2009/4/14 doug livesey <[email protected]>

> Could be wrong, but what about removing the stipulation that each call
> should be received once?
> Is that superfluous to requirements, there? I think so.
> You've already specified three calls in order, so that should cover it.
>
> 2009/4/14 Nigel Thorne <[email protected]>
>
>>  Hi Folks,
>>
>> I want to assert on an order of interaction between two objects where one
>> method gets repeated.
>>
>> Here is a simple example...
>>
>> # this fails "Mock 'x' expected :a with (any args) once, but received it 
>> twice"
>> x = mock("x")
>>
>>
>>
>> x.should_receive(:a).once.ordered
>>
>>
>>
>> x.should_receive(:b).once.ordered
>>
>>
>>
>> x.should_receive(:a).once.ordered
>>
>>
>>
>>
>> x.a
>>
>>
>> x.b
>>
>>
>>
>> x.a
>>
>>
>>
>>
>>
>> http://gist.github.com/94849
>>
>> Am I setting up the ordered expectations incorrectly, or is this a bug?
>>
>> Cheers
>> Nigel
>>
>>
>> _______________________________________________
>> rspec-users mailing list
>> [email protected]
>> http://rubyforge.org/mailman/listinfo/rspec-users
>>
>
>
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to