392
|
1 |
"{ Package: 'stx:goodies/monticello' }"
|
|
2 |
|
|
3 |
MCTestCase subclass:#MCSnapshotTest
|
|
4 |
instanceVariableNames:'snapshot'
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
|
7 |
category:'Monticello-Tests'
|
|
8 |
!
|
|
9 |
|
|
10 |
|
|
11 |
!MCSnapshotTest methodsFor:'*monticello-mocks'!
|
|
12 |
|
|
13 |
mockClassExtension
|
|
14 |
! !
|
|
15 |
|
|
16 |
!MCSnapshotTest methodsFor:'running'!
|
|
17 |
|
|
18 |
setUp
|
|
19 |
snapshot := self mockSnapshot.
|
|
20 |
! !
|
|
21 |
|
|
22 |
!MCSnapshotTest methodsFor:'tests'!
|
|
23 |
|
|
24 |
testCreation
|
|
25 |
|d|
|
|
26 |
d := self mockSnapshot definitions.
|
|
27 |
self assert: (d anySatisfy: [:ea | ea isClassDefinition and: [ea className = #MCMockClassA]]).
|
|
28 |
self assert: (d anySatisfy: [:ea | ea isMethodDefinition and: [ea selector = #mockClassExtension]]).
|
|
29 |
self assert: (d allSatisfy: [:ea | ea isClassDefinition not or: [ea category endsWith: 'Mocks']]).
|
|
30 |
|
|
31 |
!
|
|
32 |
|
|
33 |
testInstanceReuse
|
|
34 |
| x m n y |
|
|
35 |
x := (MCPackage new name: self mockCategoryName) snapshot.
|
|
36 |
Smalltalk garbageCollect.
|
|
37 |
n := MCDefinition allSubInstances size.
|
|
38 |
y := (MCPackage new name: self mockCategoryName) snapshot.
|
|
39 |
Smalltalk garbageCollect.
|
|
40 |
m := MCDefinition allSubInstances size.
|
|
41 |
self assert: m = n
|
|
42 |
! !
|
|
43 |
|
|
44 |
!MCSnapshotTest class methodsFor:'documentation'!
|
|
45 |
|
|
46 |
version
|
|
47 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCSnapshotTest.st,v 1.1 2011-08-20 13:15:34 cg Exp $'
|
|
48 |
!
|
|
49 |
|
|
50 |
version_CVS
|
|
51 |
^ '$Header: /cvs/stx/stx/goodies/monticello/MCSnapshotTest.st,v 1.1 2011-08-20 13:15:34 cg Exp $'
|
|
52 |
!
|
|
53 |
|
|
54 |
version_SVN
|
|
55 |
^ '§Id: MCSnapshotTest.st 5 2010-08-29 07:30:29Z vranyj1 §'
|
|
56 |
! !
|