Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 47 additions & 9 deletions src/Pillar-Cli-BookTester/CheckerConfigurationTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ Class {
#package : 'Pillar-Cli-BookTester'
}

{ #category : 'tests' }
CheckerConfigurationTest >> configurationEmpty [
^ ConfigurationForPillar newFromSTONDictionary: (STON fromString: '{
"attribution" : "K. De Hondt, S. Ducasse with S. Jordan Montaño and E. Lorenzano",
"keywords" : "Spec, user interface, Pharo, builder, widgets",
"title" : "Application Building with Spec 2.0",
"htmlWriter" : "html",
"latexWriter" : "miclatex:sbabook",
"tocFile": "index.md"
}')
]

{ #category : 'tests' }
CheckerConfigurationTest >> configurationIgnored [

Expand Down Expand Up @@ -114,19 +126,45 @@ CheckerConfigurationTest >> configurationTwoOnlyNoConfigureForFirst [
}')
]

{ #category : 'tests' }
CheckerConfigurationTest >> configurationWithBogusID [
^ ConfigurationForPillar newFromSTONDictionary: (STON fromString: '{
"attribution" : "K. De Hondt, S. Ducasse with S. Jordan Montaño and E. Lorenzano",
"keywords" : "Spec, user interface, Pharo, builder, widgets",
"title" : "Application Building with Spec 2.0",
"htmlWriter" : "html",
"latexWriter" : "miclatex:sbabook",
"tocFile": "index.md",
"checkerConfigurations" :
[
"BogusCheckerName" : true,
"LastPeriodInCode" : true
]
}')
]

{ #category : 'tests' }
CheckerConfigurationTest >> testConfigurationHasABogusID [
| checkers inCode |
checkers := MicAnalysisReportWriter checkersFromConfiguration:
self configurationWithBogusID.
self deny: checkers isEmpty.

inCode := checkers select: [ :each | each class checkerName = 'LastPeriodInCode' ].
self deny: inCode isEmpty.
self assert: inCode first isEndingWithPeriod
]

| checkers |
{ #category : 'tests' }
CheckerConfigurationTest >> testEmptyConfigurationLoadsAllCheckers [
| checkers allCheckers |
checkers := MicAnalysisReportWriter checkersFromConfiguration:
self configurationOnlyAndMissingConfiguration.
self assert: checkers size equals: 1.
self
assert: checkers first class checkerName
equals: 'LastPeriodInParagraphLabel'.
self
assert: checkers first levelForParagraph
equals: checkers first defaultLevelForParagraph
self configurationEmpty.

allCheckers := MicChecker allSubclasses select: [ :each |
each subclasses isEmpty ].

self assert: checkers size equals: allCheckers size
]

{ #category : 'tests' }
Expand Down