Specs now clean up after themselves by deleting the test databases

Signed-off-by: Matt Aimonetti <mattaimonetti@gmail.com>
This commit is contained in:
Will Leinweber 2009-03-21 12:14:42 +08:00 committed by Matt Aimonetti
parent f7bbee8243
commit fb7b33b1a7

View file

@ -24,3 +24,15 @@ def reset_test_db!
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