mongo-ruby-driver/test/test_db_connection.rb

17 lines
405 B
Ruby
Raw Normal View History

require 'test/test_helper'
2008-11-22 01:00:51 +00:00
# NOTE: assumes Mongo is running
class DBConnectionTest < Test::Unit::TestCase
include Mongo
2008-11-22 01:00:51 +00:00
def test_no_exceptions
host = ENV['MONGO_RUBY_DRIVER_HOST'] || 'localhost'
port = ENV['MONGO_RUBY_DRIVER_PORT'] || Connection::DEFAULT_PORT
db = Connection.new(host, port).db('ruby-mongo-demo')
2008-11-22 01:00:51 +00:00
coll = db.collection('test')
coll.remove
db.error
2008-11-22 01:00:51 +00:00
end
end