 
   describe "when the edit session is destroyed", ->
     beforeEach ->
-      spyOn(fs, 'write')
       config.set("whitespace.ensureSingleTrailingNewline", false)
 
       buffer.retain()


    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] = []

  beforeEach ->
    directory = temp.mkdirSync()
