gwanted / mgo.v2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The MongoDB driver for Go

Add a mock model for mongodb test

The origin code is from gopkg.in/mgo.v2

Usage

get this package and replace the gopkg.in/mgo.v2

example:

mgo.Mock = true // open mock model

mgo.SetMckC("Query-All",0) // in the next function ,the first query.All() will throw an error out

// TODO:add the function need to be tested here

mgo.ClearMock() // close mock query which is seted in mgo.SetMckC()

About

License:Other


Languages

Language:Go 96.7%Language:C 1.7%Language:JavaScript 1.2%Language:Shell 0.3%Language:C++ 0.1%Language:Makefile 0.0%