105
|
1 |
"{ Package: 'stx:goodies/sunit' }"
|
|
2 |
|
|
3 |
TestFailure subclass:#ResumableTestFailure
|
|
4 |
instanceVariableNames:''
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
|
7 |
category:'SUnit-Preload'
|
|
8 |
!
|
|
9 |
|
222
|
10 |
!ResumableTestFailure class methodsFor:'documentation'!
|
|
11 |
|
|
12 |
documentation
|
|
13 |
"
|
|
14 |
Sometimes it is useful to see when debugging (and/or to log when running) the results from several assertions in a test. Example:
|
|
15 |
|
|
16 |
#(‘same’ ‘*’ ‘*.txt’ ‘a*c’) with: #(‘same’ ‘any’ ‘some.txt’ ‘abc’) do:
|
|
17 |
[:eachMeta :eachString |
|
|
18 |
self assert: (eachMeta match: eachString)
|
|
19 |
description: (‘<1s> does not match <2s>’ expandMacrosWith: eachMeta with: eachString)
|
|
20 |
resumable: true].
|
|
21 |
|
|
22 |
Raising a ResumableTestFailure means that all the assertions will be run (if the test case is logging, this will print out a message to the log for each one that fails). When debugging, the user can hit ''proceed'' to continue the test and see which other expressions do not match.'
|
|
23 |
|
|
24 |
|
|
25 |
"
|
|
26 |
! !
|
105
|
27 |
|
|
28 |
!ResumableTestFailure methodsFor:'Camp Smalltalk'!
|
|
29 |
|
222
|
30 |
handleFailureWith:something
|
105
|
31 |
"resumable test failure. Continue with the test suite"
|
|
32 |
|
|
33 |
^ self resumeWith:something
|
|
34 |
!
|
|
35 |
|
|
36 |
mayProceed
|
|
37 |
|
|
38 |
^ true
|
|
39 |
!
|
|
40 |
|
222
|
41 |
sunitExitWith: aValue
|
|
42 |
|
|
43 |
^self resume: aValue
|
105
|
44 |
! !
|
|
45 |
|
|
46 |
!ResumableTestFailure class methodsFor:'documentation'!
|
|
47 |
|
|
48 |
version
|
222
|
49 |
^ '$Header: /cvs/stx/stx/goodies/sunit/ResumableTestFailure.st,v 1.2 2011-06-29 19:15:49 cg Exp $'
|
|
50 |
!
|
|
51 |
|
|
52 |
version_SVN
|
|
53 |
^ '§Id: ResumableTestFailure.st 204 2010-09-11 15:21:51Z vranyj1 §'
|
105
|
54 |
! !
|