diff --git a/spec/workspace-spec.coffee b/spec/workspace-spec.coffee index fc22f07c3..c61a57bf4 100644 --- a/spec/workspace-spec.coffee +++ b/spec/workspace-spec.coffee @@ -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