[mocha-developer] I'm misunderstanding how stubs works

Paul Butcher paul at 82ask.com
Sun Sep 24 06:38:19 EDT 2006

James Mead wrote:
> The first version doesn't work, because the second stub expectation
> doesn't replace the first. When the end_time call to Time.now comes in,
> it is matched to the first expectation and so returns the first value
> of t. I agree that this is not what you would expect and it's been on
> my todo list for a while. It hasn't made it to the top, because there
> are ways round it as you have demonstrated. I would probably use the
> same technique as you, but you might be interested to see a couple of
> other possibilities... 

Cool. Thanks James - that makes perfect sense. Glad to see that I'm not
being stupid ;-)


Paul Butcher
RE5ULT Limited
74 Eden Street,

Office: +44 (0) 1223 309080
Mobile: +44 (0) 7740 857648
Email: paul at 82ask.com
MSN: paul at paulbutcher.com
AIM: paulrabutcher
Skype: paulrabutcher
LinkedIn: https://www.linkedin.com/in/paulbutcher

82ASK: text any question to 82ASK (82275) and get the answer in minutes.
Visit www.82ask.com to get your first 2 questions answered for free.

More information about the mocha-developer mailing list