Skip to content

Commit a6b3734

Browse files
committed
Cleanup SQLite databases created by test suite
1 parent a9a0777 commit a6b3734

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ coverage/*
1717
.floo
1818
.byebug_history
1919
tmp/*
20+
test/storage/test.sqlite3*

test/cases/helper_sqlserver.rb

+7
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class TestCase < ActiveSupport::TestCase
2727

2828
setup :ensure_clean_rails_env
2929
setup :remove_backtrace_silencers
30+
setup :cleanup_sqlite_databases
3031

3132
private
3233

@@ -37,6 +38,12 @@ def ensure_clean_rails_env
3738
def remove_backtrace_silencers
3839
Rails.backtrace_cleaner.remove_silencers!
3940
end
41+
42+
# Cleanup the SQLite database created by previous runs of the Rails ActiveRecord test suite.
43+
def cleanup_sqlite_databases
44+
sqlite_db_dir = File.join(ARTest::SQLServer.test_root_sqlserver, "db")
45+
Dir.glob("#{sqlite_db_dir}/**").each { |f| File.delete(f) }
46+
end
4047

4148
def host_windows?
4249
RbConfig::CONFIG["host_os"] =~ /mswin|mingw/

0 commit comments

Comments
 (0)