<commit_before>package blueeyes.persistence.mongo.mock

import blueeyes.json.JsonAST._
import blueeyes.persistence.mongo.MongoImplicits._
import org.specs.Specification

class MockMongoSpec extends Specification{
  "create database" in{
    val mongo = new MockMongo()

    mongo.database("foo") must notBeNull
  }

  "return the same database for the same name" in{
    val mongo = new MockMongo()

    mongo.database("foo") must be (mongo.database("foo"))
  }

  "Upsert group and select should return the same object" in {
    val mongo = new MockMongo()
    val database = mongo.database("testUpsert")
    val collection = "test"

    val testObj = JObject(JField("properties.groupId", JString("foo")) :: Nil)
    database[JNothing.type](upsert(collection).set(testObj).where("groupId" === "foo"))
    val result = database(selectOne().from(collection))
    result.get must beEqual(testObj)
  }
}<commit_msg>Removed test for upsert with dotted field name<commit_after>package blueeyes.persistence.mongo.mock

import blueeyes.json.JsonAST._
import blueeyes.persistence.mongo.MongoImplicits._
import org.specs.Specification

class MockMongoSpec extends Specification{
  "create database" in{
    val mongo = new MockMongo()

    mongo.database("foo") must notBeNull
  }

  "return the same database for the same name" in{
    val mongo = new MockMongo()

    mongo.database("foo") must be (mongo.database("foo"))
  }
}
{'fraction_non_alphanumeric': 0.11126760563380282, 'fraction_numerical': 0.0, 'mean_word_length': 4.362264150943396, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '678859', 'n_tokens_mistral': 455, 'n_tokens_neox': 447, 'n_words': 118}