[Newbies] Should SUnit tests always have tearDown code?

Andy Burnett andy.burnett at knowinnovation.com
Tue Sep 30 22:07:27 UTC 2008


I have discovered that my 'dead instances' were actually being created by
the TestRunner.  I was surprised about that, because, I had assumed, that
when I closed the TestRunner window, all the instances that I had created in
the setUp code, would be Garbage Collected.  Just to be clear my setUp code
was doing nothing more complicated than e.g.

fspace := Fspace new.

When I added tearDown routines to all the tests, e.g.

fspace := nil.

The problem went away.  Is this simply how the TestRunner works, or am I
doing something wrong?

Cheers
AB
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20080930/0bb7ef22/attachment.htm


More information about the Beginners mailing list