--- a/TestCase.st Thu Aug 18 20:36:10 2011 +0200
+++ b/TestCase.st Thu Aug 18 20:37:10 2011 +0200
@@ -1,14 +1,14 @@
"{ Package: 'stx:goodies/sunit' }"
TestAsserter subclass:#TestCase
- instanceVariableNames:'testSelector'
- classVariableNames:''
- poolDictionaries:''
- category:'SUnit-Base'
+ instanceVariableNames:'testSelector'
+ classVariableNames:''
+ poolDictionaries:''
+ category:'SUnit-Base'
!
TestCase class instanceVariableNames:'lastTestRunResultOrNil lastTestRunsPassedTests lastTestRunsFailedTests
- lastTestRunsErrorTests'
+ lastTestRunsErrorTests'
"
No other class instance variables are inherited by this class.
@@ -796,22 +796,14 @@
runCase
self resources do: [:each | each availableFor: self].
- "modified to remember start- and end time, and also redirect
- std-output + Transcript to a collecting stream. The output is
- later avaliable to the reporter."
-
[
self setUp.
- startTime := Timestamp now.
- self withStandardOutputAndTranscriptRedirectedDo:[
- self performTest.
- ].
+ self performTest.
] sunitEnsure: [
- endTime := Timestamp now.
self tearDown
]
- "Modified (comment): / 09-08-2011 / 23:18:49 / cg"
+ "Modified (comment): / 18-08-2011 / 20:35:20 / cg"
!
runCaseAsFailure
@@ -833,37 +825,16 @@
!
tearDown
-!
-
-withStandardOutputAndTranscriptRedirectedDo:aBlock
- |result savedStdout savedTranscript collector|
-
- ((Smalltalk respondsTo:#isSmalltalkX) and:[Smalltalk isSmalltalkX]) ifTrue:[
- savedStdout := Stdout.
- savedTranscript := Transcript.
- collector := WriteStream on:(String new:100).
- [
- Stdout := Transcript := collector.
- result := aBlock value.
- ] ensure:[
- Stdout := savedStdout.
- Transcript := savedTranscript.
- ].
- ^ result.
- ].
-
- "/ add other dialects here...
- ^ aBlock value
! !
!TestCase class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/goodies/sunit/TestCase.st,v 1.74 2011-08-09 22:09:25 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/goodies/sunit/TestCase.st,v 1.75 2011-08-18 18:37:10 cg Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/goodies/sunit/TestCase.st,v 1.74 2011-08-09 22:09:25 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/goodies/sunit/TestCase.st,v 1.75 2011-08-18 18:37:10 cg Exp $'
!
version_SVN