minor: test fix

This commit is contained in:
Kyle Banker 2011-11-04 16:53:28 -04:00
parent 83ac53202e
commit 9cb9f5c663
2 changed files with 11 additions and 7 deletions

View File

@ -79,15 +79,15 @@ module Mongo
@refresh_required
end
def close
def close(opts={})
begin
if @primary_pool
@primary_pool.close
@primary_pool.close(opts)
end
if @secondary_pools
@secondary_pools.each do |pool|
pool.close
pool.close(opts)
end
end

View File

@ -101,14 +101,18 @@ class ReplicaSetRefreshTest < Test::Unit::TestCase
end
def test_adding_and_removing_nodes
@conn = ReplSetConnection.new([self.rs.host, self.rs.ports[0]], [self.rs.host, self.rs.ports[1]],
[self.rs.host, self.rs.ports[2]], :refresh_interval => 2, :refresh_mode => :async)
@conn = ReplSetConnection.new([self.rs.host, self.rs.ports[0]],
[self.rs.host, self.rs.ports[1]],
[self.rs.host, self.rs.ports[2]],
:refresh_interval => 2, :refresh_mode => :async)
self.rs.add_node
sleep(4)
@conn2 = ReplSetConnection.new([self.rs.host, self.rs.ports[0]], [self.rs.host, self.rs.ports[1]],
[self.rs.host, self.rs.ports[2]], :refresh_interval => 2, :refresh_mode => :async)
@conn2 = ReplSetConnection.new([self.rs.host, self.rs.ports[0]],
[self.rs.host, self.rs.ports[1]],
[self.rs.host, self.rs.ports[2]],
:refresh_interval => 2, :refresh_mode => :async)
assert @conn2.secondaries == @conn.secondaries
assert_equal 3, @conn.secondary_pools.length