@@ -25,7 +25,7 @@ describe "Spell check", ->
2525 editorElement = atom .views .getView (editor)
2626
2727 it " decorates all misspelled words" , ->
28- editor .setText (" This middle of thiss sentencts has issues and the \" edn\" 'dsoe' too" )
28+ editor .setText (" This middle of thiss\n sentencts \n\n has issues and the \" edn\" 'dsoe' too" )
2929 atom .config .set (' spell-check.grammars' , [' source.js' ])
3030
3131 decorations = null
@@ -34,12 +34,15 @@ describe "Spell check", ->
3434 decorations = editor .getHighlightDecorations (class : ' spell-check-misspelling' )
3535 decorations .length > 0
3636
37+ textForDecoration = ({marker}) ->
38+ editor .getTextInBufferRange (marker .getBufferRange ())
39+
3740 runs ->
3841 expect (decorations .length ).toBe 4
39- expect (decorations[0 ]. marker . getBufferRange ( )).toEqual [[ 0 , 15 ], [ 0 , 20 ]]
40- expect (decorations[1 ]. marker . getBufferRange ( )).toEqual [[ 0 , 21 ], [ 0 , 30 ]]
41- expect (decorations[2 ]. marker . getBufferRange ( )).toEqual [[ 0 , 51 ], [ 0 , 54 ]]
42- expect (decorations[3 ]. marker . getBufferRange ( )).toEqual [[ 0 , 57 ], [ 0 , 61 ]]
42+ expect (textForDecoration ( decorations[0 ])).toEqual " thiss "
43+ expect (textForDecoration ( decorations[1 ])).toEqual " sentencts "
44+ expect (textForDecoration ( decorations[2 ])).toEqual " edn "
45+ expect (textForDecoration ( decorations[3 ])).toEqual " dsoe "
4346
4447 it " hides decorations when a misspelled word is edited" , ->
4548 editor .setText (' notaword' )
0 commit comments