       fileUnderDir = path.join(tempDir, 'file')
       fs.writeFileSync(fileUnderDir, '')
       watcher = pathWatcher.watch tempDir, (type, path) ->
-        watcher.close()
-
         expect(type).toBe 'change'
         expect(path).toBe ''
         done()

      fs.writeFileSync(newFile, '')

  describe 'when a file under watched directory is moved', ->
    it 'fires the callback with the change event and empty path', ->
      fileUnderDir = path.join(tempDir, 'file')
      newName = path.join(tempDir, 'file2')
      fs.writeFileSync(fileUnderDir, '')
      watcher = pathWatcher.watch tempDir, (type, path) ->
        watcher.close()

        expect(type).toBe 'change'
        expect(path).toBe ''
        done()
      fs.renameSync(fileUnderDir, newName)

    it 'fires the callback with the change event and empty path', ->
      newFile = path.join(tempDir, 'file')
      watcher = pathWatcher.watch tempDir, (type, path) ->
        fs.unlinkSync(newFile)

        expect(type).toBe 'change'
