On 08/10/06, <b class="gmail_sendername">Bryan Helmkamp</b> &lt;<a href="mailto:bhelmkamp@gmail.com">bhelmkamp@gmail.com</a>&gt; wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thanks, Kevin and James.&nbsp;&nbsp;The key is instead of writing the mock like this:<br><br>foo.expects(:bar)<br>foo.expects(:bar).with(&quot;something&quot;)<br><br>You have to write it like this:<br><br>foo.expects(:bar).with()<br>
foo.expects(:bar).with(&quot;something&quot;)<br><br>The first example won't work.&nbsp;&nbsp;If you don't want to specify the<br>paramaters passed in one of the method calls, you can do:<br><br>foo.expects(:bar).times(2)<br>foo.expects
(:bar).with(&quot;something&quot;)<br><br>And that works too.<br><br>Thanks,<br><br>-Bryan<br></blockquote></div><br>I'm glad you've worked it out - I'm still not clear what the issue was.
It would be clearer if you showed the actual method calls as well as
the expectations.<br>
<br>
I'm keen to observe the principle of least surprise, so please let me
know if an aspect of the Mocha API didn't work how you expected.<br clear="all"><br>-- <br>James.<br><a href="http://blog.floehopper.org">http://blog.floehopper.org</a>