author | Claus Gittinger <cg@exept.de> |
Mon, 14 May 2018 02:21:18 +0200 | |
changeset 1048 | 582b3a028cbc |
parent 800 | 834ebea8b9c9 |
child 1121 | c5661215109c |
permissions | -rw-r--r-- |
19 | 1 |
"{ Package: 'stx:goodies/monticello/test' }" |
2 |
||
3 |
MCTestCase subclass:#MCFileInTest |
|
4 |
instanceVariableNames:'stream expected diff' |
|
5 |
classVariableNames:'' |
|
6 |
poolDictionaries:'' |
|
800
834ebea8b9c9
Tests moved to category SCM-Monticello-Tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
7 |
category:'SCM-Monticello-Tests' |
19 | 8 |
! |
9 |
||
10 |
||
11 |
!MCFileInTest methodsFor:'asserting'! |
|
12 |
||
13 |
assertNoChange |
|
14 |
| actual | |
|
15 |
actual _ MCSnapshotResource takeSnapshot. |
|
16 |
diff _ actual patchRelativeToBase: expected. |
|
17 |
self assert: diff isEmpty |
|
18 |
! ! |
|
19 |
||
20 |
!MCFileInTest methodsFor:'running'! |
|
21 |
||
22 |
setUp |
|
153 | 23 |
expected _ self mockSnapshot. |
24 |
Smalltalk isSmalltalkX ifTrue:[ |
|
25 |
stream _ (ReadWriteStream on: String new) binary. |
|
26 |
] ifFalse:[ |
|
27 |
stream _ RWBinaryOrTextStream on: String new. |
|
28 |
]. |
|
19 | 29 |
! |
30 |
||
31 |
tearDown |
|
32 |
(diff isNil or: [diff isEmpty not]) |
|
33 |
ifTrue: [expected updatePackage: self mockPackage] |
|
34 |
! ! |
|
35 |
||
36 |
!MCFileInTest methodsFor:'testing'! |
|
37 |
||
38 |
alterInitialState |
|
39 |
self mockClassA touchCVar |
|
40 |
! |
|
41 |
||
42 |
assertFileOutFrom: writerClass canBeFiledInWith: aBlock |
|
153 | 43 |
(writerClass on: stream) writeSnapshot: self mockSnapshot. |
44 |
self alterInitialState. |
|
45 |
self assertSuccessfulLoadWith: aBlock. |
|
46 |
self mockPackage unload. |
|
47 |
self assertSuccessfulLoadWith: aBlock. |
|
800
834ebea8b9c9
Tests moved to category SCM-Monticello-Tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
48 |
|
834ebea8b9c9
Tests moved to category SCM-Monticello-Tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
49 |
"Modified: / 29-05-2013 / 00:55:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
19 | 50 |
! |
51 |
||
52 |
assertInitializersCalled |
|
53 |
| cvar | |
|
54 |
cvar _ self mockClassA cVar. |
|
55 |
self assert: cvar = #initialized |
|
56 |
! |
|
57 |
||
58 |
assertSuccessfulLoadWith: aBlock |
|
153 | 59 |
stream reset. |
60 |
aBlock value. |
|
61 |
self assertNoChange. |
|
62 |
self assertInitializersCalled. |
|
800
834ebea8b9c9
Tests moved to category SCM-Monticello-Tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
63 |
|
834ebea8b9c9
Tests moved to category SCM-Monticello-Tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
64 |
"Modified: / 29-05-2013 / 00:55:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
19 | 65 |
! |
66 |
||
67 |
testStWriter |
|
153 | 68 |
self |
69 |
assertFileOutFrom: MCStWriter |
|
800
834ebea8b9c9
Tests moved to category SCM-Monticello-Tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
70 |
canBeFiledInWith: [stream fileIn]. |
834ebea8b9c9
Tests moved to category SCM-Monticello-Tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
71 |
|
834ebea8b9c9
Tests moved to category SCM-Monticello-Tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
72 |
"Modified: / 29-05-2013 / 00:55:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
19 | 73 |
! ! |
74 |
||
75 |
!MCFileInTest class methodsFor:'documentation'! |
|
76 |
||
77 |
version |
|
800
834ebea8b9c9
Tests moved to category SCM-Monticello-Tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
78 |
^ '$Header: /cvs/stx/stx/goodies/monticello/test/MCFileInTest.st,v 1.3 2013-05-28 23:59:40 vrany Exp $' |
153 | 79 |
! |
80 |
||
81 |
version_CVS |
|
800
834ebea8b9c9
Tests moved to category SCM-Monticello-Tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
82 |
^ '$Header: /cvs/stx/stx/goodies/monticello/test/MCFileInTest.st,v 1.3 2013-05-28 23:59:40 vrany Exp $' |
19 | 83 |
! ! |
800
834ebea8b9c9
Tests moved to category SCM-Monticello-Tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
153
diff
changeset
|
84 |