mirror of
https://github.com/atom/atom.git
synced 2026-01-24 22:38:20 -05:00
Fix snippet specs
This commit is contained in:
committed by
Corey Johnson & Kevin Sawicki
parent
a89fdd7714
commit
66d618a41c
@@ -12,7 +12,10 @@ describe "Snippets extension", ->
|
||||
beforeEach ->
|
||||
rootView = new RootView(require.resolve('fixtures/sample.js'))
|
||||
spyOn(LoadSnippetsTask.prototype, 'start')
|
||||
|
||||
atom.loadPackage("package-with-snippets")
|
||||
atom.loadPackage("snippets")
|
||||
|
||||
editor = rootView.getActiveEditor()
|
||||
editSession = rootView.getActiveEditSession()
|
||||
buffer = editor.getBuffer()
|
||||
@@ -20,7 +23,7 @@ describe "Snippets extension", ->
|
||||
rootView.enableKeymap()
|
||||
|
||||
afterEach ->
|
||||
rootView.remove()
|
||||
rootView.deactivate()
|
||||
delete window.snippets
|
||||
|
||||
describe "when 'tab' is triggered on the editor", ->
|
||||
@@ -232,7 +235,6 @@ describe "Snippets extension", ->
|
||||
|
||||
describe "snippet loading", ->
|
||||
beforeEach ->
|
||||
atom.packages = null
|
||||
jasmine.unspy(LoadSnippetsTask.prototype, 'start')
|
||||
spyOn(LoadSnippetsTask.prototype, 'loadAtomSnippets').andCallFake -> @snippetsLoaded({})
|
||||
spyOn(LoadSnippetsTask.prototype, 'loadTextMateSnippets').andCallFake -> @snippetsLoaded({})
|
||||
@@ -254,7 +256,6 @@ describe "Snippets extension", ->
|
||||
|
||||
it "loads snippets from all TextMate packages with snippets", ->
|
||||
jasmine.unspy(LoadSnippetsTask.prototype, 'loadTextMateSnippets')
|
||||
spyOn(console, 'warn')
|
||||
snippets.loaded = false
|
||||
snippets.loadAll()
|
||||
|
||||
@@ -271,10 +272,6 @@ describe "Snippets extension", ->
|
||||
}
|
||||
"""
|
||||
|
||||
# warn about junk-file, but don't even try to parse a hidden file
|
||||
expect(console.warn).toHaveBeenCalled()
|
||||
expect(console.warn.calls.length).toBe 1
|
||||
|
||||
it "terminates the worker when loading completes", ->
|
||||
jasmine.unspy(LoadSnippetsTask.prototype, 'loadAtomSnippets')
|
||||
spyOn(console, "warn")
|
||||
|
||||
@@ -5,7 +5,7 @@ module.exports =
|
||||
class LoadSnippetsTask extends Task
|
||||
constructor: (@snippets) ->
|
||||
super('snippets/src/load-snippets-handler')
|
||||
@packages = atom.getPackages()
|
||||
@packages = atom.getLoadedPackages()
|
||||
@packages.push(path: config.configDirPath)
|
||||
|
||||
started: ->
|
||||
|
||||
Reference in New Issue
Block a user