Hi Kevin,
Not currently, I''m afraid - I always realised it was a possible
problem, but
we haven''t run into it in our use of Mocha so far. I guess
you''re pushing
the envelope with it, which is great.
If you only need to do it for one or two objects, you could just undefine
the offending methods. In the meantime I''ll look into a better
solution. It
may not be for 24 hours or so though. I think this problem relates closely
to another of my worries - what happens when you get method name collisions
(expects & verify seem particularly vulnerable to this).
Of course, you could always submit a patch ;-)
--
James.
http://blog.floehopper.org
On 03/09/06, Kevin Clark <kevin.clark at gmail.com>
wrote:>
> Hey James,
> I''ve been adding tests to ActionPack using mocha and stubba and
I''ve
> come across one problem. Controllers decide what an action method is
> by grabbing the public instance methods and removing the explicitly
> hidden actions. I''ve got a test failing because Mocha seems to add
> methods (mocha, expects, mocha_inspect, verify...) to every Object. Is
> there a simple way for me to sanitize an object that shouldn''t
have
> those methods?
>
> --
> Kevin Clark
> http://glu.ttono.us
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://rubyforge.org/pipermail/mocha-developer/attachments/20060903/b060a324/attachment.html