<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV>There is one annoyance I'm encountering with the  Mock API in rSpec.  Overall it works well, as far as dynamic mocks go ;)... but there's this one thing... It doesn't allow overriding of expectations.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>example:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>m = mock("blah")</DIV><DIV>m.should_receive(:one).any_number_of_times().and_return(1)</DIV><DIV>m.should_receive(:one).and_return(1)</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>The second call to should_receive is ignored.  I believe it would be most convenient if the second call to should_receive would override the first.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Why? </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>What I would like to do is define all the should_receives once in the setup using any_number_of_times.  This establishes a default context.  Then in each spec I'd like to override a specific should_receive relevant to the spec.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Without being able to override, I am force to define all the should_receives for each spec..... duplication.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Is there another solution I'm missing?</DIV><BR><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>Micah Martin</DIV><DIV>8th Light, Inc.</DIV><DIV>www.8thlight.com</DIV><DIV><BR class="khtml-block-placeholder"></DIV><BR class="Apple-interchange-newline"></SPAN> </DIV><BR></BODY></HTML>