test/MCSnapshotTest.st
author Claus Gittinger <cg@exept.de>
Thu, 03 Nov 2016 13:22:28 +0100
changeset 1014 8e77e7bafd66
parent 816 ad7b435d0718
child 1118 1cd9e0a3805b
permissions -rw-r--r--
#BUGFIX by cg class: MCMczWriter changed: #flush obsolete method called.

"{ Package: 'stx:goodies/monticello/test' }"

MCTestCase subclass:#MCSnapshotTest
	instanceVariableNames:'snapshot'
	classVariableNames:''
	poolDictionaries:''
	category:'SCM-Monticello-Tests'
!


!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/test/MCSnapshotTest.st,v 1.2 2013-05-29 00:01:35 vrany Exp $'
! !