       stream.on "error", (err)->
         done(err)
       stream.on "end", ()->
-        keys = (k for k of data)
+        keys = Object.keys(data)
         count--
         assert.equal keys.length, count
         for k,v of data

    it "should filter data through database", (done)->
      count = 0
      data = {}
      stream = ReadStream
        db:db
        keyAsBuffer: false
        ValueAsBuffer: false
        filter: (k,v)->

describe "ReadStream", ->
  db = initTestDB()
  describe ".create", ->
    it "should create a ReadStream via db argument", ->
      stream = ReadStream(db)
      should.exist stream, "stream"
      stream.should.be.instanceOf ReadStream
      should.exist stream._iterator, "iterator should be exists"
    it "should create a ReadStream via options.db", ->
      stream = ReadStream(null, {db:db})
      should.exist stream
      stream.should.be.instanceOf ReadStream
      should.exist stream._iterator, "iterator should be exists"
  describe ".read", ->
    it "should read all data through database", (done)->
      data = {}
      stream = ReadStream(db, {keyAsBuffer: false, ValueAsBuffer: false})
      stream.on "data", (item)->
        data[item.key] = item.value
      stream.on "error", (err)->
