minor: clean up after tests RUBY-86

This commit is contained in:
Kyle Banker 2010-01-21 14:50:08 -05:00
parent 95d9d6b4f6
commit faa626b421

View File

@ -28,6 +28,7 @@ namespace :test do
Rake::Task['test:unit'].invoke
Rake::Task['test:functional'].invoke
Rake::Task['test:pooled_threading'].invoke
Rake::Task['test:drop_databases'].invoke
ENV['C_EXT'] = nil
end
@ -37,6 +38,7 @@ namespace :test do
Rake::Task['test:unit'].invoke
Rake::Task['test:functional'].invoke
Rake::Task['test:pooled_threading'].invoke
Rake::Task['test:drop_databases'].invoke
end
Rake::TestTask.new(:unit) do |t|
@ -73,6 +75,15 @@ namespace :test do
t.test_files = FileList['test/replica/query_test.rb']
t.verbose = true
end
task :drop_databases do |t|
puts "Dropping test database..."
require File.join(File.dirname(__FILE__), 'lib', 'mongo')
include Mongo
con = Connection.new(ENV['MONGO_RUBY_DRIVER_HOST'] || 'localhost',
ENV['MONGO_RUBY_DRIVER_PORT'] || Connection::DEFAULT_PORT)
con.drop_database('ruby-mongo-test')
end
end
desc "Generate documentation"