mirror of
https://github.com/atom/atom.git
synced 2026-02-17 18:11:29 -05:00
Replace Editor.setBuffer with Editor.edit
This commit is contained in:
@@ -345,13 +345,13 @@ describe "Autocomplete", ->
|
||||
autocomplete.attach()
|
||||
expect(autocomplete.buildWordList).not.toHaveBeenCalled()
|
||||
|
||||
describe "when a new buffer is assigned on editor", ->
|
||||
describe "when a new edit session is assigned on editor", ->
|
||||
it 'creates and uses a new word list based on new buffer', ->
|
||||
wordList = autocomplete.wordList
|
||||
expect(wordList).toContain "quicksort"
|
||||
expect(wordList).not.toContain "Some"
|
||||
|
||||
editor.setBuffer new Buffer(require.resolve('fixtures/sample.txt'))
|
||||
editor.edit(fixturesProject.open('sample.txt'))
|
||||
|
||||
wordList = autocomplete.wordList
|
||||
expect(wordList).not.toContain "quicksort"
|
||||
@@ -359,7 +359,7 @@ describe "Autocomplete", ->
|
||||
|
||||
it 'stops listening to previous buffers change events', ->
|
||||
previousBuffer = editor.buffer
|
||||
editor.setBuffer new Buffer(require.resolve('fixtures/sample.txt'))
|
||||
editor.edit(fixturesProject.open('sample.txt'))
|
||||
spyOn(autocomplete, "buildWordList")
|
||||
|
||||
previousBuffer.change([[0,0],[0,1]], "sauron")
|
||||
|
||||
Reference in New Issue
Block a user