     [filePath, bufferToDelete] = []
 
     beforeEach (done) ->
-      filePath = join(temp.dir, 'atom-file-to-delete.txt')
+      tempDir = temp.mkdirSync()
+      filePath = join(tempDir, 'atom-file-to-delete.txt')
       fs.writeFileSync(filePath, 'delete me')
       bufferToDelete = new TextBuffer({filePath, load: false})
       filePath = bufferToDelete.getPath() # symlinks may have been converted

    [filePath, newPath, bufferToChange, eventHandler] = []

    beforeEach (done) ->
      filePath = join(__dirname, "fixtures", "manipulate-me")
      newPath = "#{filePath}-i-moved"
      fs.writeFileSync(filePath, "")
      bufferToChange = new TextBuffer({filePath, load: false})

  buffer = null

  beforeEach ->
    temp.track()
    jasmine.addCustomEqualityTester(require("underscore-plus").isEqual)
    # When running specs in Atom, setTimeout is spied on by default.
    jasmine.useRealClock?()

  afterEach ->
    buffer?.destroy()
    buffer = null

  describe "construction", ->
