author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Sat, 03 Sep 2016 09:08:25 +0100 | |
branch | jv |
changeset 664 | e31b2e7b658d |
parent 222 | 8e6f482297fa |
child 724 | 4dae63fce9f9 |
permissions | -rw-r--r-- |
222 | 1 |
"{ Package: 'stx:goodies/sunit' }" |
2 |
||
664
e31b2e7b658d
FIX: Do not treat skipped test as passed!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
222
diff
changeset
|
3 |
"{ NameSpace: Smalltalk }" |
e31b2e7b658d
FIX: Do not treat skipped test as passed!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
222
diff
changeset
|
4 |
|
222 | 5 |
ManyTestResourceTestCase subclass:#CircularTestResourceTestCase |
6 |
instanceVariableNames:'' |
|
7 |
classVariableNames:'' |
|
8 |
poolDictionaries:'' |
|
9 |
category:'SUnit-Tests' |
|
10 |
! |
|
11 |
||
12 |
||
13 |
!CircularTestResourceTestCase class methodsFor:'accessing'! |
|
14 |
||
15 |
resources |
|
16 |
^super resources, (Array with: SimpleTestResourceCircular) |
|
17 |
! ! |
|
18 |
||
19 |
!CircularTestResourceTestCase methodsFor:'running'! |
|
20 |
||
21 |
testTearDownOrder |
|
22 |
SimpleTestResourceCircular preventAvailabilityDuring: |
|
23 |
[self should: [SimpleTestResourceCircular reset; isAvailable] raise: TestResult failure. |
|
24 |
self assert: SimpleTestResourceCircular rawCurrentForTest == false |
|
25 |
description: 'Circular resource not in failed setUp state'. |
|
26 |
self assert: SimpleTestResourceCircular1 rawCurrentForTest == false |
|
27 |
description: 'Circular resource not in failed setUp state'. |
|
28 |
super testTearDownOrder. |
|
29 |
self assert: SimpleTestResourceCircular1 rawCurrentForTest == nil |
|
30 |
description: 'Circular resource not in failed setUp state'. |
|
31 |
self assert: SimpleTestResourceCircular rawCurrentForTest == nil |
|
32 |
description: 'Circular resource not reset after pre-tearDown iteration']. |
|
33 |
! ! |
|
34 |
||
35 |
!CircularTestResourceTestCase methodsFor:'utility'! |
|
36 |
||
37 |
clearOuterResourceStateDuring: aBlock |
|
38 |
"To let the test run at all, we only make it circular when the preventAvailability instvar is set." |
|
39 |
||
40 |
^super clearOuterResourceStateDuring: |
|
41 |
[SimpleTestResourceCircular reset. |
|
42 |
self deny: SimpleTestResourceCircular1 isAlreadyAvailable |
|
43 |
description: 'SimpleTestResourceCircular1 should never be available'. |
|
44 |
SimpleTestResourceCircular preventAvailabilityDuring: |
|
45 |
[self should: aBlock raise: TestResult failure]. |
|
46 |
self deny: SimpleTestResourceCircular isAlreadyAvailable |
|
47 |
description: 'SimpleTestResourceCircular was set up despite having circularity set']. |
|
48 |
! ! |
|
49 |
||
50 |
!CircularTestResourceTestCase class methodsFor:'documentation'! |
|
51 |
||
52 |
version_SVN |
|
53 |
^ '§Id: CircularTestResourceTestCase.st 214 2011-03-14 12:22:21Z vranyj1 §' |
|
54 |
! ! |
|
664
e31b2e7b658d
FIX: Do not treat skipped test as passed!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
222
diff
changeset
|
55 |