[rspec-users] Do message expectations work in story steps?

Rick DeNatale rick.denatale at gmail.com
Sun May 4 20:39:28 EDT 2008


I've never tried to use them myself, but another list member brought
this up in another thread.

He was using a message expectation in a story step, and couldn't get it to fail.

Looking at what he was doing, it didn't look to me that it would ever
succeed, which got me thinking.

Message expectations are implemented in rspec by asking the mock
framework to verify them after each example by calling
verify_mocks_for_rspec.

This seems to be the only place where this is called, so I've got my
doubts that message expectations ever get verified when a story is
run.

Now, it's not clear just when in a story a message expectation should
be tested, and it's probably the case that they shouldn't be
used/supported in stories.

If so should this be documented somewhere, or is it already?

-- 
Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/


More information about the rspec-users mailing list