[mocha-developer] Module stubbing methods?
jamesmead44 at gmail.com
Fri Feb 22 05:07:44 EST 2008
On 22/02/2008, James Mead <jamesmead44 at gmail.com> wrote:
> Hi Ken,
> Your message got bounced by mailman - I'm guessing it didn't like your p7s attachment, but I'm not really sure.
> I'm re-posting to the list on your behalf...
> On 22/02/2008, Ken Collins <ken at metaskills.net> wrote:
> > I found myself wondering about this when I needed to stub a helper
> > method that test weather a rails app is in production mode or not. Has
> > anyone run into Module stubbing needs at all and or is it a
> > possibility that Mocha could do some ruby-fu to accomodate an
> > any_instance style behavior on them?
> > General thoughts?
> > - Thanks,
> > Ken
Oops. Not sure what happened with the font size - sorry.
I think you can already do what you want. I've tried to write some
explanatory examples .
The key is that you need to stub module instance methods directly on
the *instance* which extends the module, rather than on the module
I hope that helps.
More information about the mocha-developer