     it 'fires the callback with the event type and empty path', ->
       eventType = null
       eventPath = null
-      watcher = pathWatcher.watch tempFile.path, (type, path) ->
+      watcher = pathWatcher.watch tempFile, (type, path) ->
         eventType = type
         eventPath = path
 
-      fs.writeFileSync(tempFile.path, 'changed')
+      fs.writeFileSync(tempFile, 'changed')
       waitsFor -> eventType?
       runs ->
         expect(eventType).toBe 'change'

    it 'fires the callback with the event type and new path and watches the new path', ->
      eventType = null
      eventPath = null
      watcher = pathWatcher.watch tempFile.path, (type, path) ->
        eventType = type
        eventPath = path

      tempRenamed = temp.path('node-pathwatcher-renamed')
      fs.renameSync(tempFile.path, tempRenamed)
      waitsFor -> eventType?
      runs ->
        expect(eventType).toBe 'rename'

  describe '.getWatchedPaths()', ->
    it 'returns an array of all watched paths', ->
      expect(pathWatcher.getWatchedPaths()).toEqual []
      watcher1 = pathWatcher.watch tempFile, ->
      expect(pathWatcher.getWatchedPaths()).toEqual [tempFile]
      watcher2 = pathWatcher.watch tempFile, ->
      expect(pathWatcher.getWatchedPaths()).toEqual [tempFile]
      watcher1.close()
      expect(pathWatcher.getWatchedPaths()).toEqual [tempFile]
      watcher2.close()
      expect(pathWatcher.getWatchedPaths()).toEqual []

  describe '.closeAllWatchers()', ->
    it 'closes all watched paths', ->
      expect(pathWatcher.getWatchedPaths()).toEqual []
      watcher = pathWatcher.watch tempFile, ->
      expect(pathWatcher.getWatchedPaths()).toEqual [tempFile]
      pathWatcher.closeAllWatchers()
      expect(pathWatcher.getWatchedPaths()).toEqual []

