mirror of
https://github.com/atom/atom.git
synced 2026-02-06 04:34:55 -05:00
Only load TextMate packages as needed in specs
Also: when a TextMate package is deactivated, remove its grammars
This commit is contained in:
committed by
Nathan Sobo
parent
8340a084d3
commit
8437f3ff7f
@@ -9,13 +9,11 @@ Package = require 'package'
|
||||
describe "Snippets extension", ->
|
||||
[buffer, editor, editSession] = []
|
||||
beforeEach ->
|
||||
atom.activatePackage('javascript.tmbundle', sync: true)
|
||||
window.rootView = new RootView
|
||||
rootView.open('sample.js')
|
||||
|
||||
packageWithSnippets = atom.loadPackage("package-with-snippets")
|
||||
spyOn(atom, "getLoadedPackages").andCallFake ->
|
||||
textMatePackages = window.textMatePackages.filter (pack) -> /package-with-a-cson-grammar|test|textmate-package|javascript/.test(pack.name)
|
||||
textMatePackages.concat([packageWithSnippets])
|
||||
|
||||
spyOn(require("snippets/lib/snippets"), 'loadAll')
|
||||
atom.activatePackage("snippets")
|
||||
@@ -238,6 +236,9 @@ describe "Snippets extension", ->
|
||||
|
||||
describe "snippet loading", ->
|
||||
beforeEach ->
|
||||
atom.loadPackage('textmate-package.tmbundle', sync: true)
|
||||
atom.loadPackage('package-with-snippets')
|
||||
|
||||
jasmine.unspy(window, "setTimeout")
|
||||
jasmine.unspy(snippets, 'loadAll')
|
||||
spyOn(snippets, 'loadAtomSnippets').andCallFake (path, done) -> done()
|
||||
|
||||
@@ -4,6 +4,8 @@ describe "Spell check", ->
|
||||
[editor] = []
|
||||
|
||||
beforeEach ->
|
||||
atom.activatePackage('text.tmbundle', sync: true)
|
||||
atom.activatePackage('javascript.tmbundle', sync: true)
|
||||
window.rootView = new RootView
|
||||
rootView.open('sample.js')
|
||||
config.set('spell-check.grammars', [])
|
||||
|
||||
@@ -180,6 +180,11 @@ describe "StatusBar", ->
|
||||
expect(statusBar.gitStatusIcon).toHaveText('+1')
|
||||
|
||||
describe "grammar label", ->
|
||||
beforeEach ->
|
||||
atom.activatePackage('text.tmbundle', sync: true)
|
||||
atom.activatePackage('javascript.tmbundle', sync: true)
|
||||
syntax.trigger 'grammars-loaded'
|
||||
|
||||
it "displays the name of the current grammar", ->
|
||||
expect(statusBar.find('.grammar-name').text()).toBe 'JavaScript'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user