       watcher2.close()
       expect(pathWatcher.getWatchedPaths()).toEqual []
 
-  describe ".closeAllWatchers()", ->
-    it "closes all watched paths", ->
+  describe '.closeAllWatchers()', ->
+    it 'closes all watched paths', ->
       expect(pathWatcher.getWatchedPaths()).toEqual []
       watcher = pathWatcher.watch '/tmp/watch.txt', ->
       expect(pathWatcher.getWatchedPaths()).toEqual ['/tmp/watch.txt']
       pathWatcher.closeAllWatchers()
       expect(pathWatcher.getWatchedPaths()).toEqual []
 
-  describe "when a watched path is changed", ->
-    it "fires the callback with the event type and empty path", ->
+  describe 'when a watched path is changed', ->
+    it 'fires the callback with the event type and empty 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']

        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) ->
