« Return to Thread: Ignore all methods except for one call

Re: Ignore all methods except for one call

by Nat Pryce :: Rate this Message:

Reply to Author | View in Thread

2009/4/13 Steve Freeman <steve@...>:
> Yes. We used to have more complex search options but it was too confusing,
> so now it's first-to-last.
>
> We should write this up more clearly...

It's documented here: http://www.jmock.org/dispatch.html

>> I found how to do it. The order in which expectations are set is
>> important. If I put ignoring() at the end it will only get there if any
>> previous expectations didnt match.

Yes, but it will also get there if hasADeploymentInProcess() is called
more than once which does not appear to be what you want.

It seems odd, to me, that you are expecting a *query* once, and
ignoring commands.  Why is it important that the object under test
only calls hasADeploymentInProgress once?  Why not just allow that to
return true and ignore everything else (in which case, putting the
ignoring(mockReleasePackage); call last *will* do what you want).

--Nat

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


 « Return to Thread: Ignore all methods except for one call