spec/spec_helper.rb in couchrest-0.23 vs spec/spec_helper.rb in couchrest-0.24
- old
+ new
@@ -21,6 +21,18 @@
def reset_test_db!
cr = TEST_SERVER
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