     connectResolveCallbacks[1](mockDb)
     mockCollection.insertAsync.calledOnce.should.be.true
 
-    mongo.MongoClient.connectAsync = replacedConnectAsync
+    mongo.connectAsync = replacedConnectAsync


  it 'should defer .find() calls until connection established', ->
    connectResolveCallbacks = []
    replacedConnectAsync = mongo.MongoClient.connectAsync
    mongo.MongoClient.connectAsync = sinon.stub().returns
      then: (cb) -> connectResolveCallbacks.push cb
      isPending: -> true
    mockDb =

    target._mongo.db.foo.should.equal 'bar'

  it 'should connect to mongo if db is a string', ->
    replacedConnectAsync = mongo.connectAsync
    mongo.connectAsync = sinon.stub().returns
      then: ->

    target = {}
    mixin = MongodbMixin 'mongodb://127.0.0.1:27017/test'
    mixin target

    mongo.connectAsync.calledOnce.should.be.true
    mongo.connectAsync = replacedConnectAsync

  it 'should wrap collection methods into pump', ->
    mockDb =
