-
Notifications
You must be signed in to change notification settings - Fork 66
/
testReportFailure.st
27 lines (27 loc) · 1.4 KB
/
testReportFailure.st
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
testing
testReportFailure
| runner reporter stream result expectedTests index |
runner := SmalltalkCI testRunnerClass runClasses: {SCIExcludedTests} named: 'SmalltalkCI-Excluded'.
stream := WriteStream on: (String new: 1000).
reporter := SCITestReporterStdout report: runner on: stream.
result := stream contents.
expectedTests := SmalltalkCITest expectedTests: SCIExcludedTests.
"Check content and respect order"
index := result findString: '##############'.
self assert: index > 0.
index := result findString: SmalltalkCI ansiBold, SmalltalkCI ansiBlue startingAt: index.
self assert: index > 0.
index := result findString: 'SmalltalkCI-Excluded' startingAt: index.
self assert: index > 0.
index := result findString: expectedTests size asString, ' Tests' startingAt: index.
self assert: index > 0.
index := result findString: runner failedTests asString, ' Failures and' startingAt: index.
self assert: index > 0.
index := result findString: runner erroredTests asString, ' Errors' startingAt: index.
self assert: index > 0.
index := result findString: '(', runner passingTests asString ,' tests passed)' startingAt: index.
self assert: index > 0.
index := result findString: (runner failedTests + runner erroredTests) asString ,' tests did not pass' startingAt: index.
self assert: index > 0.
index := result findString: SmalltalkCI ansiBold, SmalltalkCI ansiRed startingAt: index.
self assert: index > 0.