 
     atom.activatePackage('whitespace')
 
-  afterEach ->
-    fs.remove(filePath) if fs.exists(filePath)
-
   it "strips trailing whitespace before an editor saves a buffer", ->
-    spyOn(fs, 'write')
-
     config.set("whitespace.ensureSingleTrailingNewline", false)
 
     # works for buffers that are already open when extension is initialized

temp = require 'temp'

describe "Whitespace", ->
  [editor, buffer, filePath, directory] = []

  beforeEach ->
    directory = temp.mkdirSync()


  describe "when the edit session is destroyed", ->
    beforeEach ->
      config.set("whitespace.ensureSingleTrailingNewline", false)

      buffer.retain()
