pillar
pillar copied to clipboard
BookTester tests are creating files on the disc
and it would be better to work in memory.
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 ].
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.
I mistakenly push my fix branch on pillar-markup/pillar. Can it be removed, please. Thanks