diff --git a/spec/whitespace-spec.coffee b/spec/whitespace-spec.coffee index 8b689d4..5a13f15 100644 --- a/spec/whitespace-spec.coffee +++ b/spec/whitespace-spec.coffee @@ -1,21 +1,21 @@ -fsUtils = require 'fs-utils' +{fs} = require 'atom' describe "Whitespace", -> [editor, buffer, path] = [] beforeEach -> path = "/tmp/atom-whitespace.txt" - fsUtils.writeSync(path, "") + fs.writeSync(path, "") editor = project.open(path) buffer = editor.getBuffer() atom.activatePackage('whitespace') afterEach -> - fsUtils.remove(path) if fsUtils.exists(path) + fs.remove(path) if fs.exists(path) it "strips trailing whitespace before an editor saves a buffer", -> - spyOn(fsUtils, 'write') + spyOn(fs, 'write') config.set("whitespace.ensureSingleTrailingNewline", false) @@ -25,7 +25,7 @@ describe "Whitespace", -> expect(editor.getText()).toBe "foo\nbar\n\nbaz" # works for buffers that are opened after extension is initialized - editor = project.open(require.resolve('fixtures/sample.txt')) + editor = project.open('sample.txt') editor.moveCursorToEndOfLine() editor.insertText(" ") @@ -34,7 +34,7 @@ describe "Whitespace", -> describe "when the edit session is destroyed", -> beforeEach -> - spyOn(fsUtils, 'write') + spyOn(fs, 'write') config.set("whitespace.ensureSingleTrailingNewline", false) buffer.retain()