[rspec-users] State-based expectations (as per jMock in GOOS)

Ashley Moran ashley.moran at patchspace.co.uk
Sat Dec 19 20:54:05 EST 2009

On 18 Dec 2009, at 14:46, Tom Stuart wrote:

> Can you elaborate? From a position of no knowledge, the most obvious question to me is: why would I care about the state of O? Either the change in O's state is observable through its behaviour (in which case I specify that behaviour) or it's not (in which case I don't care).

On further investigation (aka reading up to chapter 24) it's apparent that this state-based testing is effectively a flexible form of message expectation ordering.  What's clever is that it gives an intermediate level between no ordering and sequential ordering.  It's like ordering "sets" of expectations, at least that's how it appears to me at first glance.

Worth more investigation, I think...



More information about the rspec-users mailing list