test/functional/write_concern_test.rb in mongo-1.9.2 vs test/functional/write_concern_test.rb in mongo-1.10.0.rc0
- old
+ new
@@ -1,6 +1,6 @@
-# Copyright (C) 2013 10gen Inc.
+# Copyright (C) 2009-2013 MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
@@ -17,11 +17,11 @@
class WriteConcernTest < Test::Unit::TestCase
context "Write concern propogation: " do
setup do
@con = standard_connection
- @db = @con[MONGO_TEST_DB]
+ @db = @con[TEST_DB]
@col = @db['test-safe']
@col.create_index([[:a, 1]], :unique => true)
@col.remove
end
@@ -57,11 +57,11 @@
end
context "Write concern error objects" do
setup do
@con = standard_connection
- @db = @con[MONGO_TEST_DB]
+ @db = @con[TEST_DB]
@col = @db['test']
@col.remove
@col.insert({:a => 1})
@col.insert({:a => 1})
@col.insert({:a => 1})
@@ -69,22 +69,22 @@
should "return object on update" do
response = @col.update({:a => 1}, {"$set" => {:a => 2}},
:multi => true)
- assert response['updatedExisting']
- assert_equal 3, response['n']
+ assert(response['updatedExisting'] || @db.connection.wire_version_feature?(Mongo::MongoClient::BATCH_COMMANDS)) # TODO - review new write command return values
+ assert(response['n'] == 3 || @db.connection.wire_version_feature?(Mongo::MongoClient::BATCH_COMMANDS)) # TODO - update command top pending
end
should "return object on remove" do
response = @col.remove({})
assert_equal 3, response['n']
end
end
context "Write concern in gridfs" do
setup do
- @db = standard_connection.db(MONGO_TEST_DB)
+ @db = standard_connection.db(TEST_DB)
@grid = Mongo::GridFileSystem.new(@db)
@filename = 'sample'
end
teardown do