From 95673b390db4bf594219fbfabb434d4f15c696e3 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 17 Sep 2013 16:15:53 -0700 Subject: [PATCH] Use relative paths when resolving --- spec/root-view-spec.coffee | 4 ++-- spec/syntax-spec.coffee | 4 ++-- spec/task-spec.coffee | 4 ++-- spec/text-mate-grammar-spec.coffee | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/spec/root-view-spec.coffee b/spec/root-view-spec.coffee index 37c152141..5793b7deb 100644 --- a/spec/root-view-spec.coffee +++ b/spec/root-view-spec.coffee @@ -219,7 +219,7 @@ describe "RootView", -> it "creates an edit session for the given path as an item on a new pane, and focuses the pane", -> editSession = rootView.open('b') expect(rootView.getActivePane().activeItem).toBe editSession - expect(editSession.getPath()).toBe fsUtils.resolveOnLoadPath('fixtures/dir/b') + expect(editSession.getPath()).toBe require.resolve('./fixtures/dir/b') expect(rootView.getActivePane().focus).toHaveBeenCalled() describe "when the changeFocus option is false", -> @@ -359,6 +359,6 @@ describe "RootView", -> rootView.eachBuffer(callback) count = 0 callbackBuffer = null - rootView.open(require.resolve('fixtures/sample.txt')) + rootView.open(require.resolve('./fixtures/sample.txt')) expect(count).toBe 1 expect(callbackBuffer).toBe rootView.getActiveView().getBuffer() diff --git a/spec/syntax-spec.coffee b/spec/syntax-spec.coffee index 0cca30ed1..ef360e032 100644 --- a/spec/syntax-spec.coffee +++ b/spec/syntax-spec.coffee @@ -28,7 +28,7 @@ describe "the `syntax` global", -> expect(syntax.selectGrammar("/hu.git/config").name).toBe "Null Grammar" it "uses the filePath's shebang line if the grammar cannot be determined by the extension or basename", -> - filePath = require.resolve("fixtures/shebang") + filePath = require.resolve("./fixtures/shebang") expect(syntax.selectGrammar(filePath).name).toBe "Ruby" it "uses the number of newlines in the first line regex to determine the number of lines to test against", -> @@ -44,7 +44,7 @@ describe "the `syntax` global", -> expect(syntax.selectGrammar("grammar.tmLanguage", fileContent).name).toBe "Property List (XML)" it "doesn't read the file when the file contents are specified", -> - filePath = require.resolve("fixtures/shebang") + filePath = require.resolve("./fixtures/shebang") filePathContents = fsUtils.read(filePath) spyOn(fsUtils, 'read').andCallThrough() expect(syntax.selectGrammar(filePath, filePathContents).name).toBe "Ruby" diff --git a/spec/task-spec.coffee b/spec/task-spec.coffee index bb7aa031a..4f841f96c 100644 --- a/spec/task-spec.coffee +++ b/spec/task-spec.coffee @@ -8,7 +8,7 @@ describe "Task", -> spyOn(console, 'error') spyOn(console, 'warn') - jqueryTask = new Task('fixtures/jquery-task-handler') + jqueryTask = new Task(require.resolve('./fixtures/jquery-task-handler')) jqueryLoaded = false jqueryTask.start (loaded) -> jqueryLoaded = loaded @@ -24,7 +24,7 @@ describe "Task", -> describe "@once(taskPath, args..., callback)", -> it "terminates the process after it completes", -> handlerResult = null - task = Task.once 'fixtures/task-spec-handler', (result) -> + task = Task.once require.resolve('./fixtures/task-spec-handler'), (result) -> handlerResult = result processClosed = false diff --git a/spec/text-mate-grammar-spec.coffee b/spec/text-mate-grammar-spec.coffee index dda003f0d..d927e804d 100644 --- a/spec/text-mate-grammar-spec.coffee +++ b/spec/text-mate-grammar-spec.coffee @@ -18,7 +18,7 @@ describe "TextMateGrammar", -> describe "@loadSync(path)", -> it "loads grammars from plists", -> - grammar = TextMateGrammar.loadSync(fsUtils.resolveOnLoadPath('fixtures/sample.plist')) + grammar = TextMateGrammar.loadSync(require.resolve('./fixtures/sample.plist')) expect(grammar.scopeName).toBe "text.plain" {tokens} = grammar.tokenizeLine("this text is so plain. i love it.") expect(tokens[0]).toEqual value: "this text is so plain. i love it.", scopes: ["text.plain", "meta.paragraph.text"]