class: TestResource
added: #safeTearDown
changed: #makeAvailable
Take care of AbortOperationRequest being raised in Debugger in tearDown
after an errornous test case.
--- 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