Skip to content

Commit

Permalink
removing class level message dict
Browse files Browse the repository at this point in the history
skip the figure for now.
  • Loading branch information
Ducasse committed Aug 3, 2024
1 parent cf19099 commit d793ed1
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 38 deletions.
1 change: 1 addition & 0 deletions src/Microdown-BookTester-Tests/MicResultTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ MicResultTest >> testExplanationUndefinedAnchor [
MicResultTest >> testUndefinedFigureFile [

| res |
self skip.
res := MicUndefinedFigureFileResult new.
res inputFileBlock: (MicInputfileBlock new path: 'myDir/foo.md').
res source: '/myDir/chapter2.md'.
Expand Down
3 changes: 0 additions & 3 deletions src/Microdown-BookTester/MicReferenceChecker.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ MicReferenceChecker >> addBadReferenceAnchor: anAnchorReference [
| micResultInstance |
micResultInstance := MicUndefinedAnchorResult new.
micResultInstance
message: (MicUndefinedAnchorResult allMessages at: #anchorIsMissing);
anchorLabel: anAnchorReference anchorLabel;
source: anAnchorReference fromFile.
results add: micResultInstance
Expand All @@ -49,8 +48,6 @@ MicReferenceChecker >> addDuplicatedAnchor: anAnchor [
| micResultInstance |
micResultInstance := MicDuplicatedAnchorResult new.
micResultInstance
message:
(MicDuplicatedAnchorResult allMessages at: #twoAnchorsSameName);
anchorLabel: anAnchor anchorLabel;
source: anAnchor fromFile.
results add: micResultInstance
Expand Down
35 changes: 0 additions & 35 deletions src/Microdown-BookTester/MicResult.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -19,51 +19,16 @@ Class {
'source',
'explanation'
],
#classInstVars : [
'allMessages'
],
#category : 'Microdown-BookTester',
#package : 'Microdown-BookTester'
}

{ #category : 'accessing' }
MicResult class >> allMessages [
^ allMessages ifNil: [
allMessages := Dictionary new.
allMessages

at: #referenceIsFine put: 'the reference defined correctly and point to a defined anchor';
at: #false put: 'Failed' ;
at: #true put: 'Passed' ;
at: #anchorIsFine put: 'the anchor is defined correctly and not duplicated elsewhere ';
at: #anchorIsMissing put: 'i represent A reference that refers to a missing anchor';
at: #twoAnchorsSameName put: '2 anchors are declared with the same name'.
^ allMessages ]
]

{ #category : 'accessing' }
MicResult class >> message: aMethodSymbol anchorLabel: aAnchorLabel [
^ self new message: (self allMessages at: aMethodSymbol); anchorLabel: aAnchorLabel asString; yourself.
]

{ #category : 'initialization' }
MicResult class >> reset [
<script>
allMessages := nil
]

{ #category : 'accessing' }
MicResult >> explanation [

^ self subclassResponsibility
]

{ #category : 'accessing' }
MicResult >> explanation: anObject [

explanation := anObject
]

{ #category : 'accessing' }
MicResult >> message [

Expand Down

0 comments on commit d793ed1

Please sign in to comment.