btakita / rr

RR (Double Ruby) is a test double framework that features a rich selection of double techniques and a terse syntax.
http://github.com/rr/rr
MIT License
501 stars 58 forks source link

No good way to specify ordered verification with spies #74

Open mcmire opened 13 years ago

mcmire commented 13 years ago

There's no way (at least that I can see) to convert the following into a spy format:

mock(user).valid? { true }.once.then.save(:validate => false)
user.some_method_that_calls_valid?_and_save

Ideally I would like to be able to say:

stub(user).valid? { true }
stub(user).save
user.some_method_that_calls_valid?_and_save
user.should have_received.valid?.then.save(:validate => false)