@@ -14,26 +14,36 @@ Class {
1414MicVocabularyCheckerTest >> generateFilesystemExample [
1515
1616 | file |
17- file := fileSystem workingDirectory / ' example1WithMistake .md' .
17+ file := fileSystem workingDirectory / ' mistakeInParagraph .md' .
1818 file writeStreamDo: [ :stream |
1919 stream nextPutAll: ' # Foo
20- Pharo is cool
20+ Pharo is cool.
21+
22+ Spec uses a sub presenter. And there is a mistake in the previous sentence.
2123
22- Spec uses a sub presenter
2324```
2425 this is a code
2526```
2627' ].
2728
28- file := fileSystem workingDirectory / ' example2WithMistake .md' .
29+ file := fileSystem workingDirectory / ' mistakeInHeader .md' .
2930 file writeStreamDo: [ :stream |
3031 stream nextPutAll: ' ## Bar
3132Pharo is **cool**
3233
33- sub-presenter is not correct.
34+ ## sub-presenter is not correct.
3435```
3536 this is a code 2
3637```
38+ ' ].
39+
40+ file := fileSystem workingDirectory / ' mistakeInUppercase.md' .
41+ file writeStreamDo: [ :stream |
42+ stream nextPutAll: ' ## Bar
43+ Pharo is **cool**
44+
45+ sub-Presenter is not correct. The checker should pay attention that the text may use a different case than the pattern.
46+
3747' ]
3848]
3949
@@ -44,14 +54,7 @@ MicVocabularyCheckerTest >> setUp [
4454 fileSystem := FileSystem memory.
4555 self generateFilesystemExample.
4656
47- checker := MicVocabularyChecker new .
48-
49-
50- ]
51-
52- { #category : ' running' }
53- MicVocabularyCheckerTest >> testCheckerExplain [
54-
57+ checker := MicVocabularyChecker new .
5558 checker pairs: {
5659 (' sub-presenter' - > ' subpresenter' ).
5760 (' sub presenter' - > ' subpresenter' ).
@@ -61,12 +64,40 @@ MicVocabularyCheckerTest >> testCheckerExplain [
6164 (' back-end' - > ' backend' ).
6265 (' back end' - > ' backend' ).
6366 (' Pharo Image' - > ' Pharo image' ) }.
67+ ]
68+
69+ { #category : ' running' }
70+ MicVocabularyCheckerTest >> testCheckerFindsMistakeInHeader [
71+
72+ checker checkProject: fileSystem / ' mistakeInHeader.md' .
73+ self deny: checker isOkay.
74+
75+ self
76+ assert: checker results first explanation
77+ equals:
78+ ' Text: sub-presenter is not correct. in file/mistakeInHeader.md contains a mistake: [sub-presenter] should not be used. We should use subpresenter'
79+ ]
80+
81+ { #category : ' running' }
82+ MicVocabularyCheckerTest >> testCheckerFindsMistakeInParagraph [
83+
84+ checker checkProject: fileSystem / ' mistakeInParagraph.md' .
85+ self deny: checker isOkay.
86+
87+ self
88+ assert: checker results first explanation
89+ equals:
90+ ' Text: Spec uses a sub presenter. And there is a mistake in the previous sentence. in file/mistakeInParagraph.md contains a mistake: [sub presenter] should not be used. We should use subpresenter'
91+ ]
92+
93+ { #category : ' running' }
94+ MicVocabularyCheckerTest >> testCheckerFindsMistakeInUppercasedText [
6495
65- checker checkProject: fileSystem / ' example1WithMistake .md' .
96+ checker checkProject: fileSystem / ' mistakeInUppercase .md' .
6697 self deny: checker isOkay.
6798
6899 self
69100 assert: checker results first explanation
70101 equals:
71- ' Text: Spec uses a sub presenter in file/example1WithMistake .md contains a mistake: [sub presenter] should not be used. We should use subpresenter'
102+ ' Text: sub-Presenter is not correct. The checker should pay attention that the text may use a different case than the pattern. in file/mistakeInUppercase .md contains a mistake: [sub- presenter] should not be used. We should use subpresenter'
72103]
0 commit comments