From bf63fa9afa905cbac81202e4f0a977e8a0d5c943 Mon Sep 17 00:00:00 2001 From: Lovro Bikic Date: Wed, 9 Oct 2024 21:44:33 +0200 Subject: [PATCH] Create DB in temp folder --- spec/spec_helper.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index f123c3e..747ffdf 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -15,4 +15,15 @@ config.expect_with :rspec do |c| c.syntax = :expect end + + database_path = File.join(__dir__, '../tmp/database') + + config.before(:suite) do + FileUtils.rm_rf([database_path]) + system 'git', 'clone', '--quiet', Bundler::Audit::Database::URL, database_path + end + + config.before do + stub_const('Bundler::Audit::Database::DEFAULT_PATH', database_path) + end end