author | Jan Vrany <jan.vrany@labware.com> |
Fri, 07 Oct 2022 12:27:15 +0100 | |
branch | jv |
changeset 773 | 5e936bce7857 |
parent 724 | 4dae63fce9f9 |
permissions | -rw-r--r-- |
724
4dae63fce9f9
vIssue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
664
diff
changeset
|
1 |
"{ Encoding: utf8 }" |
4dae63fce9f9
vIssue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
664
diff
changeset
|
2 |
|
222 | 3 |
"{ Package: 'stx:goodies/sunit' }" |
4 |
||
664
e31b2e7b658d
FIX: Do not treat skipped test as passed!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
222
diff
changeset
|
5 |
"{ NameSpace: Smalltalk }" |
e31b2e7b658d
FIX: Do not treat skipped test as passed!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
222
diff
changeset
|
6 |
|
222 | 7 |
TestResource subclass:#SimpleTestResource |
8 |
instanceVariableNames:'runningState hasRun hasSetup' |
|
9 |
classVariableNames:'' |
|
10 |
poolDictionaries:'' |
|
11 |
category:'SUnit-Tests' |
|
12 |
! |
|
13 |
||
14 |
SimpleTestResource class instanceVariableNames:'preventAvailability' |
|
15 |
||
16 |
" |
|
17 |
The following class instance variables are inherited by this class: |
|
18 |
||
19 |
TestResource - current |
|
664
e31b2e7b658d
FIX: Do not treat skipped test as passed!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
222
diff
changeset
|
20 |
TestAsserter - |
e31b2e7b658d
FIX: Do not treat skipped test as passed!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
222
diff
changeset
|
21 |
Object - |
222 | 22 |
" |
23 |
! |
|
24 |
||
25 |
||
26 |
!SimpleTestResource class methodsFor:'accessing'! |
|
27 |
||
28 |
allowAvailability |
|
29 |
^preventAvailability isNil |
|
30 |
! |
|
31 |
||
32 |
rawCurrentForTest |
|
33 |
^current |
|
34 |
! ! |
|
35 |
||
36 |
!SimpleTestResource class methodsFor:'utility'! |
|
37 |
||
38 |
preventAvailabilityDuring: aBlock |
|
39 |
"Only setter of preventAvailability." |
|
40 |
||
41 |
preventAvailability := false. |
|
42 |
^aBlock ensure: [preventAvailability := nil] |
|
43 |
! ! |
|
44 |
||
45 |
!SimpleTestResource methodsFor:'accessing'! |
|
46 |
||
47 |
runningState |
|
48 |
||
49 |
^runningState |
|
50 |
! |
|
51 |
||
52 |
runningState: aSymbol |
|
53 |
||
54 |
runningState := aSymbol |
|
55 |
! ! |
|
56 |
||
57 |
!SimpleTestResource methodsFor:'running'! |
|
58 |
||
59 |
setRun |
|
60 |
hasRun := true |
|
61 |
! |
|
62 |
||
63 |
setUp |
|
64 |
||
65 |
self runningState: self startedStateSymbol. |
|
66 |
hasSetup := true |
|
67 |
! |
|
68 |
||
69 |
startedStateSymbol |
|
70 |
||
71 |
^#started |
|
72 |
! |
|
73 |
||
74 |
stoppedStateSymbol |
|
75 |
||
76 |
^#stopped |
|
77 |
! |
|
78 |
||
79 |
tearDown |
|
80 |
||
81 |
self runningState: self stoppedStateSymbol |
|
82 |
! ! |
|
83 |
||
84 |
!SimpleTestResource methodsFor:'testing'! |
|
85 |
||
86 |
hasRun |
|
87 |
^hasRun |
|
88 |
! |
|
89 |
||
90 |
hasSetup |
|
91 |
^hasSetup |
|
92 |
! |
|
93 |
||
94 |
isAvailable |
|
95 |
^self class allowAvailability and: |
|
96 |
[self runningState == self startedStateSymbol] |
|
97 |
! ! |
|
98 |
||
99 |
!SimpleTestResource class methodsFor:'documentation'! |
|
100 |
||
101 |
version_SVN |
|
724
4dae63fce9f9
vIssue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
664
diff
changeset
|
102 |
^ '§Id: SimpleTestResource.st 214 2011-03-14 12:22:21Z vranyj1 §' |
222 | 103 |
! ! |
664
e31b2e7b658d
FIX: Do not treat skipped test as passed!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
222
diff
changeset
|
104 |