Documentation ¶
Index ¶
Constants ¶
View Source
const DefaultMongoURL = "127.0.0.1:27017"
DefaultMongoURL is the default Mongo URL for testing
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mongo ¶
type Mongo struct { suite.Suite DBName string DB *mgo.Database // contains filtered or unexported fields }
Mongo is a text fixture for use with github.com/stretchr/testify/suite tests
use it like this:
type MyTests struct { *fixtures.Mongo } func RunMyTests(t *testing.T) { suite.Run(t, &MyTests{Mongo: New(DefaultURL)}) }
func (*Mongo) SetupTest ¶
func (m *Mongo) SetupTest()
SetupTest creates a new mongo connection and DB, and attaches it to a session before each test executes
This implements the SetupTestSuite interface
func (*Mongo) TearDownTest ¶
func (m *Mongo) TearDownTest()
TearDownTest drops the database that was created in SetupTest
This implements the TearDownTestSuite interface
Click to show internal directories.
Click to hide internal directories.