Skip to content

Commit

Permalink
Breakage in specs2 on tests, for now comment shit out before I murder
Browse files Browse the repository at this point in the history
someone.
  • Loading branch information
Brendan W. McAdams committed Jul 2, 2012
1 parent 896e3a7 commit 55669c3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion mongo-driver/src/test/scala/ConcurrencyTest.scala
Expand Up @@ -37,7 +37,7 @@ class ConcurrencyTestingSpec extends Specification
def is = def is =
"The MongoDB Direct Connection" ^ "The MongoDB Direct Connection" ^
"Works concurrently" ^ "Works concurrently" ^
"Support lots of concurrent batch inserts" ! mongo(batchInsert) ^ "Support lots of concurrent batch inserts" ! mongo(batchInsert _) ^
end end


object mongo extends AroundOutside[MongoConnection] { object mongo extends AroundOutside[MongoConnection] {
Expand Down
33 changes: 17 additions & 16 deletions mongo-driver/src/test/scala/DirectConnectionSpec.scala
Expand Up @@ -39,24 +39,24 @@ class DirectConnectionSpec extends Specification


def is = def is =
"The MongoDB Direct Connection" ^ "The MongoDB Direct Connection" ^
"Connect correctly and grab isMaster, then disconnect" ! mongo(connectIsMaster) ^ "Connect correctly and grab isMaster, then disconnect" ! mongo(connectIsMaster _) ^
endp ^ endp ^
"Write Operations" ^ "Write Operations" ^
"Support 'blind' (NoOp) writes" ! mongo(noopInsert) ^ "Support 'blind' (NoOp) writes" ! mongo(noopInsert _) ^
"Support inserts with no (default) write concern" ! mongo(insertWithDefaultWriteConcern) ^ "Support inserts with no (default) write concern" ! mongo(insertWithDefaultWriteConcern _) ^
"Support inserts with implicit safe write concern" ! mongo(insertWithSafeImplicitWriteConcern) ^ "Support inserts with implicit safe write concern" ! mongo(insertWithSafeImplicitWriteConcern _) ^
"Support batch inserts" ! mongo(batchInsert) ^ "Support batch inserts" ! mongo(batchInsert _) ^
endp ^ endp ^
"Read Operations" ^ "Read Operations" ^
"Can count from a collection" ! mongo(countCmd) ^ "Can count from a collection" ! mongo(countCmd _) ^
"Iterate a simple cursor correctly" ! mongo(iterateSimpleCursor) ^ "Iterate a simple cursor correctly" ! mongo(iterateSimpleCursor _) ^
"Iterate a complex (iteratee) cursor correctly" ! mongo(iterateComplexCursor) ^ "Iterate a complex (iteratee) cursor correctly" ! mongo(iterateComplexCursor _) ^
"Correctly calculate values for 'distinct'" ! mongo(distinctValue) ^ "Correctly calculate values for 'distinct'" ! mongo(distinctValue _) ^
"Insert an ObjectId and retrieve it correctly" ! mongo(idDebug) ^ "Insert an ObjectId and retrieve it correctly" ! mongo(idDebug _) ^
endp ^ endp ^
"More detailed special commands" ^ "More detailed special commands" ^
"Support findAndModify" ! mongo(simpleFindAndModify) ^ "Support findAndModify" ! mongo(simpleFindAndModify _) ^
"Support findAndRemove" ! mongo(findAndRemoveTest) ^ "Support findAndRemove" ! mongo(findAndRemoveTest _) ^
end end
/* /*
trait mongoConn extends AroundOutside[MongoConnection] { trait mongoConn extends AroundOutside[MongoConnection] {
Expand Down Expand Up @@ -155,7 +155,7 @@ class DirectConnectionSpec extends Specification
mongo.findOne(Document("foo" -> "bar"))((_doc: Document) { mongo.findOne(Document("foo" -> "bar"))((_doc: Document) {
doc = _doc doc = _doc
}) })
doc must eventually(havePairs("foo" -> "bar", "bar" -> "baz")) doc must havePairs("foo" -> "bar", "bar" -> "baz")//.eventually BROKEN GODDAMN F-ING SPECS2
} }


def insertWithDefaultWriteConcern(conn: MongoConnection) = { def insertWithDefaultWriteConcern(conn: MongoConnection) = {
Expand All @@ -172,7 +172,7 @@ class DirectConnectionSpec extends Specification
mongo.findOne(Document("foo" -> "bar"))((_doc: Document) { mongo.findOne(Document("foo" -> "bar"))((_doc: Document) {
doc = _doc doc = _doc
}) })
doc must eventually(havePairs("foo" -> "bar", "bar" -> "baz")) doc must havePairs("foo" -> "bar", "bar" -> "baz")//.eventually BROKEN GODDAMN F-ING SPECS2
} }


def insertWithSafeImplicitWriteConcern(conn: MongoConnection) = { def insertWithSafeImplicitWriteConcern(conn: MongoConnection) = {
Expand Down Expand Up @@ -205,7 +205,8 @@ class DirectConnectionSpec extends Specification
doc = _doc doc = _doc
}) })
doc must not(beNull.eventually) doc must not(beNull.eventually)
doc must eventually(havePairs("foo" -> "bar", "bar" -> "baz")) doc must havePairs("foo" -> "bar", "bar" -> "baz")//.eventually

} }


def idDebug(conn: MongoConnection) = { def idDebug(conn: MongoConnection) = {
Expand Down Expand Up @@ -233,7 +234,7 @@ class DirectConnectionSpec extends Specification
log.debug("Inserted. %s", insertedID) log.debug("Inserted. %s", insertedID)
mongo.insert(Document("_id" -> id, "foo" -> "y", "bar" -> "x"))(handler) mongo.insert(Document("_id" -> id, "foo" -> "y", "bar" -> "x"))(handler)


insertedID must eventually(beSome(id)) //Wait for the insert to finish? insertedID must beSome(id) //.EVENTUALLYFUCKYOUSPECS2YOUPIECEOFSHIT //Wait for the insert to finish?


var savedID: Option[ObjectId] = None var savedID: Option[ObjectId] = None
//TODO - test findOneByID //TODO - test findOneByID
Expand Down

0 comments on commit 55669c3

Please sign in to comment.