diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 4e4b507..7e6800a 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -23,4 +23,16 @@ def reset_test_db! db = cr.database(TESTDB) db.recreate! rescue nil db +end + +Spec::Runner.configure do |config| + config.before(:all) { reset_test_db! } + + config.after(:all) do + cr = TEST_SERVER + test_dbs = cr.databases.select { |db| db =~ /^#{TESTDB}/ } + test_dbs.each do |db| + cr.database(db).delete! rescue nil + end + end end \ No newline at end of file