11
|
1 |
"{ Package: 'stx:goodies/monticello/test' }"
|
|
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/test/MCSnapshotTest.st,v 1.1 2006-11-22 13:01:39 cg Exp $'
|
|
48 |
! !
|