minor: clean up after tests RUBY-86
This commit is contained in:
parent
95d9d6b4f6
commit
faa626b421
11
Rakefile
11
Rakefile
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue