diff --git a/spec/support/setup_builds_storage.rb b/spec/support/setup_builds_storage.rb index a0a7120ceb5..fd729434898 100644 --- a/spec/support/setup_builds_storage.rb +++ b/spec/support/setup_builds_storage.rb @@ -3,17 +3,15 @@ RSpec.configure do |config| Rails.root.join('tmp/tests/builds') end - config.before(:each) do - FileUtils.mkdir_p(builds_path) - FileUtils.touch(File.join(builds_path, ".gitkeep")) + config.before(:suite) do Settings.gitlab_ci['builds_path'] = builds_path end - config.after(:each) do - Dir[File.join(builds_path, '*')].each do |path| - next if File.basename(path) == '.gitkeep' + config.before(:each) do + FileUtils.mkdir_p(builds_path) + end - FileUtils.rm_rf(path) - end + config.after(:each) do + FileUtils.rm_rf(builds_path) end end