       result:'some good value'
     }
     {
-      desc: 'with a single escape slash'
-      should:'should have no slash'
+      desc: 'with one escape slashes next to each other'
+      should:'should include a single slash'
       output:['some \\ value']
       values: key:'good'
-      result:'some  value'
+      result:'some \\ value'
     }
     {
       desc: 'with two escape slashes next to each other'
       should:'should include a single slash'
       output:['some \\\\ value']
       values: key:'good'
-      result:'some \\ value'
+      result:'some \\\\ value'
     }
     {
       desc: 'with escaped opening brace'
       should:'should include the brace without the slash'
-      output:['some \\{ value']
-      values: key:'good'
-      result:'some { value'
+      output:['some \\{{ value']
+      values: key:'good'
+      result:'some {{ value'
     }
     {
       desc: 'with an escape slash before first opening brace which voids key'

kevas    = require '../../lib'
strung   = require 'strung'
through  = require 'through2'

describe 'test kv-stream', ->

  shouldReplaceKeyWithValue = 'should replace the key with its value'
  for test in [

          writeout()

# TODO: set of tests using a file stream as input (use filed? or paths?)
  describe 'with json file input stream', ->

    it 'should convert unescaped keys to values', (done) ->

      dir = new Path 'test/helpers'

      file = dir.to 'kevas.json'

      expected = JSON.parse dir.to('expected.kevas.json').read()

      stream = kevas values:key:'good'

      output = strung()

      # when all writes are finished then verify the results
      output.on 'finish', (error) ->
        if error? then return done error
        result = JSON.parse output.string
        assert.deepEqual result, expected
        done() # tell Mocha the test is done

      # send any errors to Mocha's callback
      stream.on 'error', done
      output.on 'error', done

      options = # send errors to `done`
        reader:
          events:
            'error': done
        writer:
          events:
            'error': done

      # pipe our test input to our stream and then to our output collector.
      file.pipe(stream, options).pipe(output)



# TODO: set of tests using a file stream as output (use filed? or paths?)
