minor: test fix

This commit is contained in:
Kyle Banker 2012-01-26 12:07:32 -05:00
parent 07375ce024
commit 815ec63681
1 changed files with 7 additions and 3 deletions

View File

@ -68,9 +68,11 @@ class ConnectTest < Test::Unit::TestCase
assert @conn[MONGO_TEST_DB]['bar'].find_one
primary = Mongo::Connection.new(@conn.primary_pool.host, @conn.primary_pool.port)
assert_raise Mongo::ConnectionFailure do
primary['admin'].command({:replSetStepDown => 60})
end
assert @conn.connected?
assert_raise_error Mongo::ConnectionFailure, "not master" do
assert_raise Mongo::ConnectionFailure do
@conn[MONGO_TEST_DB]['bar'].find_one
end
assert !@conn.connected?
@ -90,7 +92,9 @@ class ConnectTest < Test::Unit::TestCase
step_down_command = BSON::OrderedHash.new
step_down_command[:replSetStepDown] = 60
step_down_command[:force] = true
assert_raise Mongo::ConnectionFailure do
primary['admin'].command(step_down_command)
end
rescue_connection_failure do
@conn[MONGO_TEST_DB]['bar'].save({:a => 1}, {:safe => {:w => 3}})