initial checkin
authorClaus Gittinger <cg@exept.de>
Sat, 20 Aug 2011 15:15:34 +0200
changeset 392 fd780d490e75
parent 391 03215573499f
child 393 d95cbbca60c0
initial checkin
MCSnapshotTest.st
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MCSnapshotTest.st	Sat Aug 20 15:15:34 2011 +0200
@@ -0,0 +1,56 @@
+"{ Package: 'stx:goodies/monticello' }"
+
+MCTestCase subclass:#MCSnapshotTest
+	instanceVariableNames:'snapshot'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'Monticello-Tests'
+!
+
+
+!MCSnapshotTest methodsFor:'*monticello-mocks'!
+
+mockClassExtension
+! !
+
+!MCSnapshotTest methodsFor:'running'!
+
+setUp
+	snapshot :=  self mockSnapshot.
+! !
+
+!MCSnapshotTest methodsFor:'tests'!
+
+testCreation
+	|d|
+	d :=  self mockSnapshot definitions.
+	self assert: (d anySatisfy: [:ea | ea isClassDefinition and: [ea className = #MCMockClassA]]).
+	self assert: (d anySatisfy: [:ea | ea isMethodDefinition and: [ea selector = #mockClassExtension]]).
+	self assert: (d allSatisfy: [:ea | ea isClassDefinition not or: [ea category endsWith: 'Mocks']]).
+	
+!
+
+testInstanceReuse
+	| x m n y |
+	x := (MCPackage new name: self mockCategoryName) snapshot.
+	Smalltalk garbageCollect.
+	n := MCDefinition allSubInstances size.
+	y := (MCPackage new name: self mockCategoryName) snapshot.
+	Smalltalk garbageCollect.
+	m := MCDefinition allSubInstances size.
+	self assert: m = n
+! !
+
+!MCSnapshotTest class methodsFor:'documentation'!
+
+version
+    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCSnapshotTest.st,v 1.1 2011-08-20 13:15:34 cg Exp $'
+!
+
+version_CVS
+    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCSnapshotTest.st,v 1.1 2011-08-20 13:15:34 cg Exp $'
+!
+
+version_SVN
+    ^ '§Id: MCSnapshotTest.st 5 2010-08-29 07:30:29Z vranyj1 §'
+! !