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:unit'].invoke
|
||||||
Rake::Task['test:functional'].invoke
|
Rake::Task['test:functional'].invoke
|
||||||
Rake::Task['test:pooled_threading'].invoke
|
Rake::Task['test:pooled_threading'].invoke
|
||||||
|
Rake::Task['test:drop_databases'].invoke
|
||||||
ENV['C_EXT'] = nil
|
ENV['C_EXT'] = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -37,6 +38,7 @@ namespace :test do
|
||||||
Rake::Task['test:unit'].invoke
|
Rake::Task['test:unit'].invoke
|
||||||
Rake::Task['test:functional'].invoke
|
Rake::Task['test:functional'].invoke
|
||||||
Rake::Task['test:pooled_threading'].invoke
|
Rake::Task['test:pooled_threading'].invoke
|
||||||
|
Rake::Task['test:drop_databases'].invoke
|
||||||
end
|
end
|
||||||
|
|
||||||
Rake::TestTask.new(:unit) do |t|
|
Rake::TestTask.new(:unit) do |t|
|
||||||
|
@ -73,6 +75,15 @@ namespace :test do
|
||||||
t.test_files = FileList['test/replica/query_test.rb']
|
t.test_files = FileList['test/replica/query_test.rb']
|
||||||
t.verbose = true
|
t.verbose = true
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
desc "Generate documentation"
|
desc "Generate documentation"
|
||||||
|
|
Loading…
Reference in New Issue