minor: alias #read_primary? with #primary?

This commit is contained in:
Kyle Banker 2011-01-17 13:37:41 -05:00
parent 0d91faf6b1
commit fab538ed5e
4 changed files with 4 additions and 0 deletions

View File

@ -470,6 +470,7 @@ module Mongo
def read_primary?
@read_primary
end
alias :primary? :read_primary?
# Close the connection to the database.
def close

View File

@ -137,6 +137,7 @@ module Mongo
def read_primary?
!@read_pool || @read_pool.length.zero?
end
alias :primary? :read_primary?
# Close the connection to the database.
def close

View File

@ -32,6 +32,7 @@ class ConnectTest < Test::Unit::TestCase
[RS.host, RS.ports[2]], :name => RS.name)
assert @conn.connected?
assert @conn.read_primary?
assert @conn.primary?
assert_equal RS.primary, @conn.primary
assert_equal RS.secondaries.sort, @conn.secondaries.sort

View File

@ -18,6 +18,7 @@ class ReplicaSetQuerySecondariesTest < Test::Unit::TestCase
def test_read_primary
assert !@conn.read_primary?
assert !@conn.primary?
end
def test_con