2008-11-22 01:00:51 +00:00
|
|
|
$LOAD_PATH[0,0] = File.join(File.dirname(__FILE__), '..', 'lib')
|
|
|
|
require 'mongo'
|
|
|
|
require 'test/unit'
|
|
|
|
|
|
|
|
# NOTE: assumes Mongo is running
|
|
|
|
class DBConnectionTest < Test::Unit::TestCase
|
|
|
|
|
2008-12-19 02:57:20 +00:00
|
|
|
include XGen::Mongo::Driver
|
|
|
|
|
2008-11-22 01:00:51 +00:00
|
|
|
def test_no_exceptions
|
2008-12-08 21:41:52 +00:00
|
|
|
host = ENV['MONGO_RUBY_DRIVER_HOST'] || 'localhost'
|
2008-12-19 02:57:20 +00:00
|
|
|
port = ENV['MONGO_RUBY_DRIVER_PORT'] || Mongo::DEFAULT_PORT
|
|
|
|
db = Mongo.new(host, port).db('ruby-mongo-demo')
|
2008-11-22 01:00:51 +00:00
|
|
|
coll = db.collection('test')
|
|
|
|
coll.clear
|
|
|
|
end
|
|
|
|
end
|