         expect(eventPath).toBe fs.realpathSync('/tmp/watch-renamed.txt')
         expect(pathWatcher.getWatchedPaths()).toEqual [fs.realpathSync('/tmp/watch-renamed.txt')]
 
-  describe "when a watched path is deleted", ->
-    it "fires the callback with the event type and null path", ->
+  describe 'when a watched path is deleted', ->
+    it 'fires the callback with the event type and null path', ->
       eventType = null
       eventPath = null
       watcher = pathWatcher.watch '/tmp/watch.txt', (type, path) ->

        expect(eventType).toBe 'change'
        expect(eventPath).toBe ''

  describe "when a watched path is renamed", ->
    it "fires the callback with the event type and new path and watches the new path", ->
      eventType = null
      eventPath = null
      watcher = pathWatcher.watch '/tmp/watch.txt', (type, path) ->

pathWatcher = require '../lib/main'
fs = require 'fs'

describe 'PathWatcher', ->
  beforeEach ->
    fs.writeFileSync('/tmp/watch.txt', '')

  afterEach ->
    pathWatcher.closeAllWatchers()

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