Fix snippet specs

This commit is contained in:
Corey Johnson
2013-02-06 15:52:35 -08:00
committed by Corey Johnson & Kevin Sawicki
parent a89fdd7714
commit 66d618a41c
2 changed files with 5 additions and 8 deletions

View File

@@ -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")

View File

@@ -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: ->