minor: test fix

This commit is contained in:
Kyle Banker 2011-04-15 10:58:37 -04:00
parent 043590f9a3
commit 9c30de332f
2 changed files with 8 additions and 0 deletions

View File

@ -89,6 +89,7 @@ module Mongo
# Are we allowing reads from secondaries?
@read_secondary = opts.fetch(:read_secondary, false)
@slave_okay = false
setup(opts)
end

View File

@ -123,6 +123,13 @@ class DBTest < Test::Unit::TestCase
@@db.remove_user('spongebob')
end
def test_authenticate_with_special_characters
assert @@db.add_user('foo:bar', '@foo')
assert @@db.authenticate('foo:bar', '@foo')
@@db.logout
@@db.remove_user('foo:bar')
end
def test_authenticate_with_connection_uri
@@db.add_user('spongebob', 'squarepants')
assert Mongo::Connection.from_uri("mongodb://spongebob:squarepants@#{host_port}/#{@@db.name}")