diff --git a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/newTemporaryFileNamed..st b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/newTemporaryFileNamed..st index 5e778cdd..29d781b7 100644 --- a/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/newTemporaryFileNamed..st +++ b/repository/Grease-Pharo100-Core.package/GRPharoPlatform.class/instance/newTemporaryFileNamed..st @@ -1,4 +1,7 @@ files newTemporaryFileNamed: aName - ^ (FileLocator temp / aName) pathString \ No newline at end of file + | newFile | + newFile := FileLocator temp / aName. + newFile exists ifTrue: [ GRError new signal: 'A (temporary) file with name ', aName, ' already exists.' ]. + ^ newFile pathString \ No newline at end of file diff --git a/repository/Grease-Pharo100-Core.package/monticello.meta/categories.st b/repository/Grease-Pharo100-Core.package/monticello.meta/categories.st index ecc9aa78..47e57aa2 100644 --- a/repository/Grease-Pharo100-Core.package/monticello.meta/categories.st +++ b/repository/Grease-Pharo100-Core.package/monticello.meta/categories.st @@ -1 +1 @@ -SystemOrganization addCategory: #'Grease-Pharo100-Core'! +self packageOrganizer ensurePackage: #'Grease-Pharo100-Core' withTags: #()! diff --git a/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testNewTemporaryFileNamed.st b/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testNewTemporaryFileNamed.st index 68d6ff3c..354c5403 100644 --- a/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testNewTemporaryFileNamed.st +++ b/repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testNewTemporaryFileNamed.st @@ -1,13 +1,16 @@ tests-files testNewTemporaryFileNamed - | temporaryFile | + | temporaryFile fileName | + fileName := 'GRPlatformTestTemporaryFile'. [ - temporaryFile := GRPlatform current newTemporaryFileNamed: 'test_temporary'. + temporaryFile := GRPlatform current newTemporaryFileNamed: fileName. GRPlatform current writeFileStreamOn: temporaryFile do: [ :str | str nextPutAll: 'test temporary' ] binary: false. - self assert: (GRPlatform current fileExists: temporaryFile) + self assert: (GRPlatform current fileExists: temporaryFile). + self should: [ GRPlatform current newTemporaryFileNamed: fileName ] raise: GRError. ] ensure: [ GRPlatform current deleteFile: temporaryFile ]. - self deny: (GRPlatform current fileExists: temporaryFile) \ No newline at end of file + self deny: (GRPlatform current fileExists: temporaryFile). + \ No newline at end of file