test/MCPackageTest.st
author Jan Vrany <jan.vrany@labware.com>
Fri, 17 May 2024 23:06:48 +0100
branchjv
changeset 1179 2b0400211720
parent 1121 c5661215109c
permissions -rw-r--r--
Tonel: fix possible endless recursion in `TonelRepository class >> discover:` This commit fixes horrible bug in `TonelRepository class >> discover:` when using relative directories that caused endless recursion. This is because `Filename >> directory` does not handle well relative directories: following code causes endless loop: f := '.' asFilename. [ f isRootDirectory ] whileFalse:[f := f directory]. while this one does not: f := Filename currentDirectory. [ f isRootDirectory ] whileFalse:[f := f directory]. Clearly, this is something that has to be fixed in `Filename`, but meanwhile, we fix it here too. While at it, rewrite this method using loop as opposed ro recursion.

"
COPYRIGHT (c) 2020 LabWare
"
"{ Package: 'stx:goodies/monticello/test' }"

"{ NameSpace: Smalltalk }"

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

!MCPackageTest class methodsFor:'documentation'!

copyright
"
COPYRIGHT (c) 2020 LabWare


"
! !

!MCPackageTest methodsFor:'running'!

tearDown
	self mockSnapshot install
! !

!MCPackageTest methodsFor:'tests'!

testUnload
	| mock |
	self mockPackage unload.
	self deny: (Smalltalk hasClassNamed: #MCMockClassA).
	self deny: (MCSnapshotTest includesSelector: #mockClassExtension).

	mock _ (Smalltalk at: #MCMock).
	self assert: (mock subclasses detect: [:c | c name = #MCMockClassA] ifNone: []) isNil
! !

!MCPackageTest class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/goodies/monticello/test/MCPackageTest.st,v 1.2 2013-05-28 23:59:48 vrany Exp $'
!

version_HG

    ^ '$Changeset: <not expanded> $'
! !