   iterator = null
   value = 'Hello World'
 
-  it 'should open database', ->
-    db = leveldb.openSync filename, create_if_missing: true
+  it 'should open database', (done) ->
+    leveldb.open filename, create_if_missing: true, (err, handle) ->
+      db = handle
+      done()
 
   it 'should insert batch data', ->
     batch = new leveldb.Batch


  it 'should close database', (done) ->
    db.close done
    db = null

  it 'should not get values', ->
    assert.throws -> iterator.first()

  it 'should not be valid', ->
    assert.ifError iterator.valid()

  it 'should seek to last key', (done) ->
    iterator.last done

  it 'should get values in reverse', (done) ->
    testNext = (i) ->
      iterator.prev (err, key, val) ->
        assert.ifError err
        assert.equal "#{i}", key
        assert.equal value, val
