MCSnapshotTest.st
author Claus Gittinger <cg@exept.de>
Mon, 14 May 2018 02:21:18 +0200
changeset 1048 582b3a028cbc
parent 392 fd780d490e75
permissions -rw-r--r--
#FEATURE by cg class: MCMethodDefinition changed: #postloadOver:

"{ 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 §'
! !