diff --git a/src/BaselineOfMicrodown/BaselineOfMicrodown.class.st b/src/BaselineOfMicrodown/BaselineOfMicrodown.class.st index 24e3b674..1dcb5502 100644 --- a/src/BaselineOfMicrodown/BaselineOfMicrodown.class.st +++ b/src/BaselineOfMicrodown/BaselineOfMicrodown.class.st @@ -14,20 +14,9 @@ BaselineOfMicrodown >> baseline: spec [ spec for: #common do: [ - - self xmlParserHtml: spec. - self mustache: spec. - " I disable this because against all my best effort, I cannot avoid the fucking pop up to raise - even if I unload all the packages. I get the Microdown-RichTextComposer in conflict." - - spec preLoadDoIt: #'preload:package:'. - - - "I disable this because in a postload - (IceRepository repositoryNamed: 'microdown') is nil and I do not get why" - - spec postLoadDoIt: #'postload:package:'. + self xmlParserHtml: spec. + spec package: #Microdown; package: #'Microdown-Tests' @@ -82,22 +71,10 @@ BaselineOfMicrodown >> baseline: spec [ package: #'Microdown-PrettyPrinter' with: [ spec requires: #( #Microdown ) ]; - package: #'Microdown-PrettyPrinter-Tests' - with: [ spec requires: #( #'Microdown-PrettyPrinter' #'Microdown-Tests') ]; + with: [ spec requires: #( #'Microdown-PrettyPrinter' #'Microdown-Tests') ]. - package: #'Microdown-ParentChildrenChecker' with: [ - spec requires: #( #'Microdown' ) ]; - package: #'Microdown-BookTester' with: [ - spec requires: #( #'Microdown' ) ]; - package: #'Microdown-BookTester-Tests' with: [ - spec requires: #( #'Microdown-BookTester' ) ]; - - package: #'Microdown-Blog' with: [ - spec requires: #( #'Microdown' #'Mustache') ]; - package: #'Microdown-Blog-Tests' with: [ - spec requires: #( #'Microdown-Blog' ) ]. - + "I do not want group without tests for now" spec group: 'Core' with: #('Microdown'); @@ -110,7 +87,6 @@ BaselineOfMicrodown >> baseline: spec [ #'Microdown-DocumentBrowser' #'Microdown-DocumentBrowser-Tests' " - #'Microdown-Evaluator' #'Microdown-Evaluator-Tests' #'Microdown-PrettyPrinter' @@ -120,72 +96,10 @@ BaselineOfMicrodown >> baseline: spec [ #'Microdown-LaTeXExporter' #'Microdown-LaTeXExporter-Tests' #'Microdown-Transformer' - #'Microdown-Transformer-Tests' - #'Microdown-ParentChildrenChecker' - #'Microdown-BookTester' - #'Microdown-BookTester-Tests' - - ); + #'Microdown-Transformer-Tests'); group: 'All' with: #('Core' 'Tests' 'Extensions' 'Microdown-Pharo-Tools' 'RichText') ] ] -{ #category : 'baselines' } -BaselineOfMicrodown >> mustache: spec [ - - spec baseline: 'Mustache' with: [ - spec - repository: 'github://noha/mustache:v1.0/repository'; - loads: #( 'Core' 'Tests' ) ] -] - -{ #category : 'baselines' } -BaselineOfMicrodown >> postload: loader package: packageSpec [ - - | p | - self class name, ' postload ' traceCr. - - p := (IceRepository repositoryNamed: 'microdown'). - p ifNil: [ p := (IceRepository repositoryNamed: 'Microdown') ]. - [ - (p ifNotNil: [ :p2 | (p2 packageNamed: 'BaselineOfMicrodown') reload ]) - ] - on: MCMergeOrLoadWarning - do: [ :ex | ex load ] - - - -] - -{ #category : 'baselines' } -BaselineOfMicrodown >> preload: loader package: packageSpec [ - "Ignore pre and post loads if already executed" - - " the prelosing GH script cannot work because - it will remove the baseline and repository itself :) - #( 'Microdown' ) do: [ :name | - (IceRepository repositoryNamed: name) - ifNil: [ self inform: 'Project not found: ' , name ] - ifNotNil: [ :found | - found - unload; - forget ] ]" - - | packagesToUnload | - self class name, ' preload ' traceCr. - packagesToUnload := ((PackageOrganizer default packages - select: [ :each | each name beginsWith: 'Microdown' ]) collect: [ :each | each name ]) - reject: [ :each | - #('Microdown-RichTextPresenter' 'Microdown-RichTextPresenter-Tests') includes: each ]. - "these two are not managed by the microdown repo but the documentation. - I should rename them in the future to avoid confusion" - - packagesToUnload do: - [ :each | - ((IceRepository repositoryNamed: 'Microdown') packageNamed: each) unload ]. - - -] - { #category : 'external projects' } BaselineOfMicrodown >> xmlParserHtml: spec [ diff --git a/src/Microdown-PrettyPrinter-Tests/MicTextualMicrodownExporterTest.class.st b/src/Microdown-PrettyPrinter-Tests/MicTextualMicrodownExporterTest.class.st index 63ba1a11..98932ff6 100644 --- a/src/Microdown-PrettyPrinter-Tests/MicTextualMicrodownExporterTest.class.st +++ b/src/Microdown-PrettyPrinter-Tests/MicTextualMicrodownExporterTest.class.st @@ -5,7 +5,8 @@ Class { 'factory', 'visitor', 'visitorClass', - 'parser' + 'parser', + 'file' ], #pools : [ 'MicroSharedPool' @@ -36,7 +37,8 @@ MicTextualMicrodownExporterTest >> setUp [ super setUp. factory := MicMicrodownSnippetFactory new. visitor := self visitorClass new. - parser := Microdown new + parser := Microdown new. + file := FileSystem memory / 'test.md'. ] { #category : 'tests-anchor' } @@ -322,17 +324,17 @@ MicTextualMicrodownExporterTest >> testMetaData [ { #category : 'tests - list' } MicTextualMicrodownExporterTest >> testMetaDataIsWellExported [ - - | source newDocument | - source := ' - { - "author" : "Inria" - } - '. - newDocument := parser parse: source. + + | newDocument | + + file ensureCreateFile. + newDocument := parser parse: factory metaDataSample. visitor visit: newDocument. - self assert: (visitor contents includesSubstring: '"author" : "Inria"'). + self assert: (visitor contents includesSubstring: '"title" : "The title"') . + file writeStreamDo: [ :stream | stream nextPutAll: visitor contents ]. + file delete. +