Start of new DB API tests.

This commit is contained in:
Jim Menard 2008-12-01 19:39:39 -05:00
parent 8459fcad5b
commit 01c1590744
1 changed files with 24 additions and 0 deletions

24
tests/test_db_api.rb Normal file
View File

@ -0,0 +1,24 @@
$LOAD_PATH[0,0] = File.join(File.dirname(__FILE__), '..', 'lib')
require 'mongo'
require 'test/unit'
# NOTE: assumes Mongo is running
class DBAPITest < Test::Unit::TestCase
def setup
@db = XGen::Mongo::Driver::Mongo.new.db('ruby-mongo-test')
@coll = @db.collection('test')
@coll.clear
end
def teardown
@coll.clear
end
def test_clear
@coll.insert('a' => 1)
assert_equal 1, @coll.count
@coll.clear
assert_equal 0, @coll.count
end
end