Specs now clean up after themselves by deleting the test databases
Signed-off-by: Matt Aimonetti <mattaimonetti@gmail.com>
This commit is contained in:
parent
f7bbee8243
commit
fb7b33b1a7
1 changed files with 12 additions and 0 deletions
|
@ -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
|
Loading…
Reference in a new issue