[rspec-users] Do you think it would look cleaner?

Zach Dennis zach.dennis at gmail.com
Thu Jan 3 12:39:19 EST 2008

On Jan 3, 2008 12:20 PM, Kerry Buckley <kerry at kerrybuckley.com> wrote:
> On 2 Jan 2008, at 22:09, David Chelimsky wrote:
> > On Jan 2, 2008 5:20 PM, Zach Dennis <zach.dennis at gmail.com> wrote:
> >
> >> RSpec doesn't enforce strict-order mocking.
> >
> > Sure it does, if you ask it to:
> > http://rspec.info/documentation/mocks/message_expectations.html
> Am I right, though, in thinking that you can't enforce order between
> two mocks? It would occasionally be nice to be able to say something
> like:
> master.should_receive(:start).and_then(slave).should_receive(:start)

I'd like to be proven wrong again, but I don't think you can do this
with rspec. From running some examples in irb it looks like each mock
only verifies its own order. Hardmock does support this. Flexmock does
not that I am aware of, and Mocha most certainly does not.

 Hardmock considers all expectations ordered across all mocks.
Hardmock does work with rspec too:

Zach Dennis

More information about the rspec-users mailing list