Resolve CSON file using require

This commit is contained in:
Kevin Sawicki 2013-09-19 11:30:10 -07:00
parent d754c473fc
commit 5c8b1a1f11

View File

@ -23,7 +23,7 @@ describe "TextMateGrammar", ->
expect(tokens[0]).toEqual value: "this text is so plain. i love it.", scopes: ["text.plain", "meta.paragraph.text"]
it "loads grammars from cson files", ->
grammar = TextMateGrammar.loadSync(fs.resolveOnLoadPath('spec/fixtures/packages/package-with-grammars/grammars/alot.cson'))
grammar = TextMateGrammar.loadSync(require.resolve('./fixtures/packages/package-with-grammars/grammars/alot.cson'))
expect(grammar.scopeName).toBe "source.alot"
{tokens} = grammar.tokenizeLine("this is alot of code")
expect(tokens[1]).toEqual value: "alot", scopes: ["source.alot", "keyword.alot"]