Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(68)

Unified Diff: testing/mgo_test.go

Issue 6560045: testing: don't panic if mongod is missing (Closed)
Patch Set: testing: don't panic if mongod is missing Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « testing/mgo.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/mgo_test.go
=== modified file 'testing/mgo_test.go'
--- testing/mgo_test.go 2012-08-21 15:02:11 +0000
+++ testing/mgo_test.go 2012-09-26 01:26:37 +0000
@@ -4,20 +4,26 @@
"labix.org/v2/mgo/bson"
. "launchpad.net/gocheck"
"launchpad.net/juju-core/testing"
+ stdtesting "testing"
)
type mgoSuite struct{}
-var _ = Suite(mgoSuite{})
-
-func (mgoSuite) TestMgoStartAndClean(c *C) {
- server, dbdir := testing.StartMgoServer()
+var _ = Suite(&mgoSuite{})
+
+func TestMgoSuite(t *stdtesting.T) {
+ TestingT(t)
+}
+
+func (s *mgoSuite) TestMgoStartAndClean(c *C) {
+ server, dbdir, err := testing.StartMgoServer()
+ c.Assert(err, IsNil)
defer testing.MgoDestroy(server, dbdir)
c.Assert(testing.MgoAddr, Not(Equals), "")
session := testing.MgoDial()
menu := session.DB("food").C("menu")
- err := menu.Insert(
+ err = menu.Insert(
bson.D{{"spam", "lots"}},
bson.D{{"eggs", "fried"}},
)
« no previous file with comments | « testing/mgo.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b