Should SUnit tests always have tearDown code?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Should SUnit tests always have tearDown code?

Andy Burnett
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

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners