Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit b53c6bc

Browse files
committed
Use multi-line strings in spec
1 parent 706bc26 commit b53c6bc

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

spec/spell-check-spec.coffee

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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\nsentencts\n\nhas 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

Comments
 (0)