11describe " Spell check" , ->
22 [workspaceElement , editor , editorElement ] = []
33
4+ textForDecoration = ({marker}) ->
5+ editor .getTextInBufferRange (marker .getBufferRange ())
6+
47 beforeEach ->
58 workspaceElement = atom .views .getView (atom .workspace )
69
@@ -34,8 +37,6 @@ describe "Spell check", ->
3437 decorations = editor .getHighlightDecorations (class : ' spell-check-misspelling' )
3538 decorations .length > 0
3639
37- textForDecoration = ({marker}) ->
38- editor .getTextInBufferRange (marker .getBufferRange ())
3940
4041 runs ->
4142 expect (decorations .length ).toBe 4
@@ -44,6 +45,20 @@ describe "Spell check", ->
4445 expect (textForDecoration (decorations[2 ])).toEqual " edn"
4546 expect (textForDecoration (decorations[3 ])).toEqual " dsoe"
4647
48+ it " doesn't consider our company's name to be a spelling error" , ->
49+ editor .setText (" GitHub (aka github): Where codez are built." )
50+ atom .config .set (' spell-check.grammars' , [' source.js' ])
51+
52+ decorations = null
53+
54+ waitsFor ->
55+ decorations = editor .getHighlightDecorations (class : ' spell-check-misspelling' )
56+ decorations .length > 0
57+
58+ runs ->
59+ expect (decorations .length ).toBe 1
60+ expect (textForDecoration (decorations[0 ])).toBe " codez"
61+
4762 it " hides decorations when a misspelled word is edited" , ->
4863 editor .setText (' notaword' )
4964 advanceClock (editor .getBuffer ().getStoppedChangingDelay ())
0 commit comments