From 99db98f6e80f5cbe1efaf76364171fc4e5960e86 Mon Sep 17 00:00:00 2001 From: Jim Menard Date: Tue, 2 Dec 2008 07:26:45 -0500 Subject: [PATCH] Made db.full_coll_name public. Wrote a test for it. --- lib/mongo/db.rb | 4 ++-- tests/test_db_api.rb | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/mongo/db.rb b/lib/mongo/db.rb index e1f48a8..67346a0 100644 --- a/lib/mongo/db.rb +++ b/lib/mongo/db.rb @@ -160,12 +160,12 @@ module XGen @socket.print(message.buf.to_s) end - protected - def full_coll_name(collection) "#{@name}.#{collection}" end + protected + def db_command(selector) # TODO synchronize q = Query.new(selector) diff --git a/tests/test_db_api.rb b/tests/test_db_api.rb index f6270c4..00bb845 100644 --- a/tests/test_db_api.rb +++ b/tests/test_db_api.rb @@ -76,4 +76,8 @@ class DBAPITest < Test::Unit::TestCase # Mongo bug: returns string with wrong length, so last byte of value is chopped off. # assert_equal @coll.name, row['options']['create'] end + + def test_full_coll_name + assert_equal @coll_full_name, @db.full_coll_name(@coll.name) + end end