-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- rename inptuFileFinder into InputFileExpressionCollector - Add tests to InputFileExpressionCollectorTest - add comment to MicFileIncluder - fix little glitches in MicBookTesterVisitor
- Loading branch information
Showing
5 changed files
with
146 additions
and
39 deletions.
There are no files selected for viewing
96 changes: 96 additions & 0 deletions
96
src/Microdown-BookTester-Tests/MicInputFileExpressionCollectorTest.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
Class { | ||
#name : 'MicInputFileExpressionCollectorTest', | ||
#superclass : 'TestCase', | ||
#instVars : [ | ||
'fs', | ||
'dir' | ||
], | ||
#category : 'Microdown-BookTester-Tests', | ||
#package : 'Microdown-BookTester-Tests' | ||
} | ||
|
||
{ #category : 'accessing' } | ||
MicInputFileExpressionCollectorTest >> fileSystem [ | ||
|
||
^ FileSystem memory | ||
] | ||
|
||
{ #category : 'running' } | ||
MicInputFileExpressionCollectorTest >> setUp [ | ||
|
||
super setUp. | ||
fs := self fileSystem. | ||
dir := (fs / 'myDirectory') asFileReference. | ||
dir ensureCreateDirectory | ||
] | ||
|
||
{ #category : 'tests' } | ||
MicInputFileExpressionCollectorTest >> testAllInputInASingleFile [ | ||
|
||
| doc visitor | | ||
doc := Microdown parse: '# Section 1 | ||
|
||
<!inputFile|path=Chapters/Intro.md!> | ||
%Reviewed by stef - anchor | ||
|
||
# All Spec in One Example | ||
|
||
<!inputFile|path=Chapters/FirstContact.md!> | ||
|
||
<!inputFile|path=Chapters/CaseStudyOne.md!> | ||
%Reviewed by stef - anchor | ||
|
||
# Spec Essentials | ||
|
||
<!inputFile|path=InANutshell.md!> | ||
|
||
'. | ||
visitor := MicInputFileExpressionCollector new. | ||
doc accept: visitor. | ||
self | ||
assert: (visitor allFiles collect: [:each | each path relativePath ] ) | ||
equals: OrderedCollection <- #('Chapters/Intro.md' 'Chapters/FirstContact.md' 'Chapters/CaseStudyOne.md' 'InANutshell.md') | ||
|
||
|
||
|
||
] | ||
|
||
{ #category : 'tests' } | ||
MicInputFileExpressionCollectorTest >> testAllInputsTwoSingleFile [ | ||
|
||
| doc visitor doc2 | | ||
doc := Microdown parse: '# Section 1 | ||
|
||
<!inputFile|path=Chapters/Intro.md!> | ||
%Reviewed by stef - anchor | ||
|
||
# All Spec in One Example | ||
|
||
<!inputFile|path=Chapters/FirstContact.md!> | ||
|
||
<!inputFile|path=Chapters/CaseStudyOne.md!> | ||
%Reviewed by stef - anchor | ||
|
||
# Spec Essentials | ||
|
||
<!inputFile|path=InANutshell.md!> | ||
|
||
'. | ||
|
||
doc2 := Microdown parse: '# Section 2 | ||
|
||
|
||
<!inputFile|path=Chapters/FirstContact2.md!> | ||
|
||
|
||
'. | ||
visitor := MicInputFileExpressionCollector new. | ||
doc accept: visitor. | ||
doc2 accept: visitor. | ||
self | ||
assert: (visitor allFiles collect: [:each | each path relativePath ] ) | ||
equals: OrderedCollection <- #('Chapters/Intro.md' 'Chapters/FirstContact.md' 'Chapters/CaseStudyOne.md' 'InANutshell.md' 'Chapters/FirstContact2.md') | ||
|
||
|
||
|
||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters