This commit is contained in:
joshaber
2016-04-25 15:34:46 -04:00
parent cf1b4e2217
commit 6852d6e91c

View File

@@ -1619,3 +1619,15 @@ describe "Workspace", ->
escapeStringRegex = (str) ->
str.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&')
describe "grammar activation", ->
it "activates grammars", ->
editor = null
atom.workspace.handleGrammarUsed = jasmine.createSpy()
waitsForPromise -> atom.workspace.open('sample-with-comments.js').then (o) -> editor = o
runs ->
atom.grammars.setGrammarOverrideForPath(editor.getPath(), 'source.coffee')
editor.reloadGrammar()
waitsFor -> atom.workspace.handleGrammarUsed.callCount is 1