     fs.writeFile fileToTest, '',done
 
   afterEach (done) ->
-    fs.unlink(fileToTest, done) 
+    fs.unlink(fileToTest, done)
 
   lineEndings = [{le:'\r\n', desc: "Windows"}, {le:'\n', desc: "Linux"}]
 

    tailedFile = new Tail(fileToTest, {fromBeginning:true, fsWatchOptions: {interval:100}})
    tailedFile.on 'line', (line) ->
      readLines.push(line)
      if (readLines.length is lines.length) 
        match = readLines.reduce((acc, val, idx)-> 
          acc and (val is lines[idx])
        , true)
        
        if match 
          tailedFile.unwatch()
          done()



  #       text = [0..lines].map (c) ->
  #         return "aaaaaaaa#{c}"

  #       tailedFile = new Tail fileToTest, {logger: console}

  #       cnt = 0
  #       tailedFile.on 'line', (line) ->
  #         if line != text[cnt]
  #           console.log(line, text[cnt])
  #           done('line is different:#{line} <> #{text[cnt]}')
  #         cnt++
  #         done() if lines == cnt

  #       tailedFile.on 'error', (line) ->
  #         console.log('error:' + line)

  #       for l, i in text
  #         fs.write fd, "#{l}\n", (e, bw, b) ->
  #           if i == text.length-1
  #             console.log("close")
  #             fs.closeSync fd

  #     .timeout(10000)
