[rspec-users] Expecting arbitrary method calls in a particular order

Sven Fuchs svenfuchs at artweb-design.de
Sun Jul 13 09:49:13 EDT 2008

I've been wondering how to expect arbitrary methods being called in a  
particular order. The RSpec documentation for expecting method calls  
on mock objects mentions that it is possible to pass a block to  
#should_receive, but does not mention that it can be used to track the  
method call order pretty easily:


Is there a better way of doing this?

If not, do you think it would make sense to add this to the RSpec  
docs? http://rspec.info/documentation/mocks/message_expectations.html

sven fuchs			svenfuchs at artweb-design.de
artweb design		http://www.artweb-design.de
grünberger 65		+ 49 (0) 30 - 47 98 69 96 (phone)
d-10245 berlin		+ 49 (0) 171 - 35 20 38 4 (mobile)

More information about the rspec-users mailing list