Made db.full_coll_name public. Wrote a test for it.
This commit is contained in:
parent
8b82d716dd
commit
99db98f6e8
|
@ -160,12 +160,12 @@ module XGen
|
||||||
@socket.print(message.buf.to_s)
|
@socket.print(message.buf.to_s)
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
|
||||||
|
|
||||||
def full_coll_name(collection)
|
def full_coll_name(collection)
|
||||||
"#{@name}.#{collection}"
|
"#{@name}.#{collection}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
protected
|
||||||
|
|
||||||
def db_command(selector)
|
def db_command(selector)
|
||||||
# TODO synchronize
|
# TODO synchronize
|
||||||
q = Query.new(selector)
|
q = Query.new(selector)
|
||||||
|
|
|
@ -76,4 +76,8 @@ class DBAPITest < Test::Unit::TestCase
|
||||||
# Mongo bug: returns string with wrong length, so last byte of value is chopped off.
|
# Mongo bug: returns string with wrong length, so last byte of value is chopped off.
|
||||||
# assert_equal @coll.name, row['options']['create']
|
# assert_equal @coll.name, row['options']['create']
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_full_coll_name
|
||||||
|
assert_equal @coll_full_name, @db.full_coll_name(@coll.name)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue