pillar icon indicating copy to clipboard operation
pillar copied to clipboard

BookTester tests are creating files on the disc

Open Ducasse opened this issue 6 years ago • 3 comments

and it would be better to work in memory.

Ducasse avatar Aug 04 '19 17:08 Ducasse

See PRScreenshotTransformerTest setUp

super setUp.
testingFileSystem := FileSystem memory workingDirectory.
(testingFileSystem / PRTransformerEnvironmentTest pillarAnnotationsFileNameForTest)
	writeStreamDo: [ :stream | 
		stream nextPutAll: PRTransformerEnvironmentTest pillarAnnotationsContentsForTest ].
((FileLocator image / 'figures') isFile)
	ifFalse: [ (FileLocator imageDirectory / 'figures') ensureCreateDirectory ].

Ducasse avatar Aug 04 '19 17:08 Ducasse

I am fixing it. Now the setUp method is using FileSystem memory. But when visiting screenshot annotations, the system is explicitly creating screenshots on FileSystem.

It should use workingDirectory of the screenshot transformer

	
	"The png can be found under the file name YourBook/YourChapter/figures/screenshots/'YourChapter-SystemWindowName'.png"
	"The name of the png file itself is Class>>Method-TimeAndDate"
	| filePath |
	filePath := (FileSystem workingDirectory / 'figures' / 'screenshots').
	(filePath isFile)
		ifFalse: [ filePath ensureCreateDirectory ].
	PNGReadWriter putForm: self imageForm onFileNamed: 
		filePath / aFileName.

samakhov avatar Nov 01 '19 09:11 samakhov

I mistakenly push my fix branch on pillar-markup/pillar. Can it be removed, please. Thanks

samakhov avatar Nov 01 '19 10:11 samakhov