Can Mox enforce a global mock method call ordering?

18 views
Skip to first unread message

JT Olds

unread,
Mar 1, 2012, 6:10:53 PM3/1/12
to mox-discuss
Hey all,

So it looks to me like, within a given mock object, by default, the
ordering of method calls on that mock object is enforced. This is
super useful.

However, I have a few tests that have a number of mocked objects
coordinating. For example, I have a test with a mocked mutex and a
mocked disk library. I want to make sure that the ordering of calls to
the mock mutex and the mocked disk library are globally ordered, and
not just independently.

Can mox do this? Can mox enforce a global method call ordering (by
global, I mean within a given mox.Mox() session)? How hard would it be
to add?

Thanks
-JT

Steve Middlekauff

unread,
Mar 5, 2012, 11:29:06 AM3/5/12
to mox-d...@googlegroups.com
It's currently not possible, but some people internally at work were asking for this too.
I assume it should be somewhat easy to add.  I don't have a ton of spare time to work on
it, but I'd be happy to review a patch.
 
--
You received this message because you are subscribed to the Google Groups "mox-discuss" group.
To post to this group, send email to mox-d...@googlegroups.com.
To unsubscribe from this group, send email to mox-discuss...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mox-discuss?hl=en.


JT Olds

unread,
Mar 5, 2012, 3:04:08 PM3/5/12
to mox-d...@googlegroups.com
Cool beans. I just wrote this on a flight, so hopefully it's not too hastily written.

Patch attached, hopefully I didn't miss any corner cases or something.

-JT
0001-optional-session-wide-call-ordering.patch
Reply all
Reply to author
Forward
0 new messages