class: TestResource
authorStefan Vogel <sv@exept.de>
Tue, 23 Apr 2013 12:33:43 +0200
changeset 577 3dea1e941af7
parent 576 55ef6aaf19cb
child 578 be4d2b6894b9
class: TestResource added: #safeTearDown changed: #makeAvailable Take care of AbortOperationRequest being raised in Debugger in tearDown after an errornous test case.
TestResource.st
--- a/TestResource.st	Tue Apr 23 12:33:23 2013 +0200
+++ b/TestResource.st	Tue Apr 23 12:33:43 2013 +0200
@@ -73,7 +73,7 @@
 !TestResource class methodsFor:'others'!
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/goodies/sunit/TestResource.st,v 1.10 2013-04-17 18:42:06 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/goodies/sunit/TestResource.st,v 1.11 2013-04-23 10:33:43 stefan Exp $'
 ! !
 
 !TestResource class methodsFor:'private'!
@@ -98,7 +98,7 @@
     ] sunitEnsure:[
         didSetup ifTrue:[
             current == candidate ifFalse:[
-                candidate tearDown
+                candidate safeTearDown
             ]
         ]
     ].
@@ -208,6 +208,16 @@
 	aStream nextPutAll: self class printString
 ! !
 
+!TestResource methodsFor:'private'!
+
+safeTearDown
+    "Have to handle Abort. When tearDown is called as inside an ensure block after
+     an abort in the debugger of an errornous test case and raises an error with a debugger
+     itself."
+
+    AbortOperationRequest handle:[:ex| ] do:[self tearDown].
+! !
+
 !TestResource methodsFor:'running'!
 
 setUp
@@ -242,7 +252,7 @@
 !TestResource class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/goodies/sunit/TestResource.st,v 1.10 2013-04-17 18:42:06 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/goodies/sunit/TestResource.st,v 1.11 2013-04-23 10:33:43 stefan Exp $'
 !
 
 version_SVN