[mocha-developer] New error?

James Mead jamesmead44 at gmail.com
Wed Feb 6 11:28:52 EST 2008

On 06/02/2008, Ned Wolpert <ned.wolpert at gmail.com> wrote:
> After more testing, the problem is the mocha changes conflict with a
> suggestion made by Ola Bini
> http://ola-bini.blogspot.com/2007/12/your-ruby-tests-are-memory-leaks.html
> We added his suggestion (which for some reason actually made the tests
> run faster) and by removing it causes the latest mocha changes to not
> fail on our code. Bini's code removes (forceably) all instance
> variables set during the unit test... so its basically killing the
> Mocha variables simply because its not referenced in his code-base.
> So, its not a bug with Mocha, but an assumption of the variables that
> exist within the TestCase framework that Bini's code makes... I do
> appreciate your help. I find it difficult to figure out what
> 'sandboxes' are safe to play in with the Rails project and its
> plugins... and initial introspection into Bini's code did not seem
> like a bad thing. Seems like there should be a better 'discovery'
> technique on necessary variables though.  (Side note, this is the
> first time Mocha added an instance variable to the test case itself,
> right? It would explain why this just happened recently.)
> Thanks again.

Wow! Well done for figuring that out. Yes, I think it is the first time
Mocha has added an instance variable to the test case - I've been doing some
significant refactoring recently.

I can probably do without it and perhaps that would be a less invasive
approach. I'll give it some more thought.

Thanks for being tenacious enough to find the problem :-)

More information about the mocha-developer mailing list