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
|
@ -23,4 +23,16 @@ def reset_test_db!
|
||||||
db = cr.database(TESTDB)
|
db = cr.database(TESTDB)
|
||||||
db.recreate! rescue nil
|
db.recreate! rescue nil
|
||||||
db
|
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
|
end
|
Loading…
Reference in a new issue