Help with SUnit

Michael Roberts mike at mjr104.co.uk
Thu Jan 22 22:27:58 UTC 2004


On Thu, Jan 22, 2004 at 01:41:33PM -0800, Ned Konz wrote:
> 
> What's happening is that tearDown is being called before the debugger opens. 
> Thus your stream gets nil'd out and you can't test it.
ok, err, I could ask why.  Do you mean that this is a bug?
> 
> > runCaseAsFailure: aSemaphore
> > 	[self setUp.
> > 	self openDebuggerOnFailingTestMethod] sunitEnsure: [
> > 		self tearDown.
> > 		aSemaphore signal]
> >
> > which should be the same place that opened the debugger earlier.
> >
> > 7) how does the block to sunitEnsure: wait for
> > openDebuggerOnFailingTestMethod to finish?  It should just be a normal
> > block being sent >>value.
> 
> Ah, but it doesn't finish. Instead the assert raises an exception, which kicks 
> the tearDown method.
> 
> See if it works the way you want if you take out the assignment to stream in 
> your tearDown method.
> 
well, it would work in this instance, but I'm not sure that this is desirable with a more complex test?

> My own feeling on this is that probably the tearDown should be moved inside 
> the openDebugger... method along with performTest so you can see your context 
> better and you won't get tearDown called when an exception is raised.
> 
that sounds great.  I'm happy to test any improvements :-) but I appreciate that you're a busy man.

Cheers

Mike



More information about the Squeak-dev mailing list