From 690bbbd14cb827af88e8921de7532f43c55a91e1 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Wed, 5 Mar 2014 21:34:31 -0700 Subject: [PATCH] :lipstick: Fix indentation level of the last describe in editor-spec I think I screwed it up in the last commit --- spec/editor-spec.coffee | 84 ++++++++++++++++++++--------------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/spec/editor-spec.coffee b/spec/editor-spec.coffee index 8684b179e..d02ed2b35 100644 --- a/spec/editor-spec.coffee +++ b/spec/editor-spec.coffee @@ -2741,67 +2741,67 @@ describe "Editor", -> editor.reloadGrammar() expect(editor.getGrammar().name).toBe 'CoffeeScript' -describe "when the editor's grammar has an injection selector", -> - beforeEach -> + describe "when the editor's grammar has an injection selector", -> + beforeEach -> - waitsForPromise -> - atom.packages.activatePackage('language-text') + waitsForPromise -> + atom.packages.activatePackage('language-text') - waitsForPromise -> - atom.packages.activatePackage('language-javascript') - - it "includes the grammar's patterns when the selector matches the current scope in other grammars", -> - waitsForPromise -> - atom.packages.activatePackage('language-hyperlink') - - runs -> - grammar = atom.syntax.selectGrammar("text.js") - {tokens} = grammar.tokenizeLine("var i; // http://github.com") - - expect(tokens[0].value).toBe "var" - expect(tokens[0].scopes).toEqual ["source.js", "storage.modifier.js"] - - expect(tokens[6].value).toBe "http://github.com" - expect(tokens[6].scopes).toEqual ["source.js", "comment.line.double-slash.js", "markup.underline.link.http.hyperlink"] - - describe "when the grammar is added", -> - it "retokenizes existing buffers that contain tokens that match the injection selector", -> - editor = atom.project.openSync('sample.js') - editor.setText("// http://github.com") - - {tokens} = editor.lineForScreenRow(0) - expect(tokens[1].value).toBe " http://github.com" - expect(tokens[1].scopes).toEqual ["source.js", "comment.line.double-slash.js"] + waitsForPromise -> + atom.packages.activatePackage('language-javascript') + it "includes the grammar's patterns when the selector matches the current scope in other grammars", -> waitsForPromise -> atom.packages.activatePackage('language-hyperlink') runs -> - {tokens} = editor.lineForScreenRow(0) - expect(tokens[2].value).toBe "http://github.com" - expect(tokens[2].scopes).toEqual ["source.js", "comment.line.double-slash.js", "markup.underline.link.http.hyperlink"] + grammar = atom.syntax.selectGrammar("text.js") + {tokens} = grammar.tokenizeLine("var i; // http://github.com") - describe "when the grammar is updated", -> + expect(tokens[0].value).toBe "var" + expect(tokens[0].scopes).toEqual ["source.js", "storage.modifier.js"] + + expect(tokens[6].value).toBe "http://github.com" + expect(tokens[6].scopes).toEqual ["source.js", "comment.line.double-slash.js", "markup.underline.link.http.hyperlink"] + + describe "when the grammar is added", -> it "retokenizes existing buffers that contain tokens that match the injection selector", -> editor = atom.project.openSync('sample.js') - editor.setText("// SELECT * FROM OCTOCATS") + editor.setText("// http://github.com") {tokens} = editor.lineForScreenRow(0) - expect(tokens[1].value).toBe " SELECT * FROM OCTOCATS" + expect(tokens[1].value).toBe " http://github.com" expect(tokens[1].scopes).toEqual ["source.js", "comment.line.double-slash.js"] waitsForPromise -> - atom.packages.activatePackage('package-with-injection-selector') + atom.packages.activatePackage('language-hyperlink') runs -> + {tokens} = editor.lineForScreenRow(0) + expect(tokens[2].value).toBe "http://github.com" + expect(tokens[2].scopes).toEqual ["source.js", "comment.line.double-slash.js", "markup.underline.link.http.hyperlink"] + + describe "when the grammar is updated", -> + it "retokenizes existing buffers that contain tokens that match the injection selector", -> + editor = atom.project.openSync('sample.js') + editor.setText("// SELECT * FROM OCTOCATS") + {tokens} = editor.lineForScreenRow(0) expect(tokens[1].value).toBe " SELECT * FROM OCTOCATS" expect(tokens[1].scopes).toEqual ["source.js", "comment.line.double-slash.js"] - waitsForPromise -> - atom.packages.activatePackage('language-sql') + waitsForPromise -> + atom.packages.activatePackage('package-with-injection-selector') - runs -> - {tokens} = editor.lineForScreenRow(0) - expect(tokens[2].value).toBe "SELECT" - expect(tokens[2].scopes).toEqual ["source.js", "comment.line.double-slash.js", "keyword.other.DML.sql"] + runs -> + {tokens} = editor.lineForScreenRow(0) + expect(tokens[1].value).toBe " SELECT * FROM OCTOCATS" + expect(tokens[1].scopes).toEqual ["source.js", "comment.line.double-slash.js"] + + waitsForPromise -> + atom.packages.activatePackage('language-sql') + + runs -> + {tokens} = editor.lineForScreenRow(0) + expect(tokens[2].value).toBe "SELECT" + expect(tokens[2].scopes).toEqual ["source.js", "comment.line.double-slash.js", "keyword.other.DML.sql"]