mongo-ruby-driver/test/db_connection_test.rb

16 lines
403 B
Ruby
Raw Normal View History

require File.expand_path("../test_helper", __FILE__)
2008-11-22 01:00:51 +00:00
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
2010-04-05 19:48:35 +00:00
db = Connection.new(host, port).db(MONGO_TEST_DB)
2008-11-22 01:00:51 +00:00
coll = db.collection('test')
coll.remove
db.get_last_error
2008-11-22 01:00:51 +00:00
end
end