Remove entire test files directory for test builds

This commit is contained in:
Grzegorz Bizon 2016-11-23 11:52:38 +01:00
parent d917ac0f86
commit 01f588edbc

View file

@ -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'
FileUtils.rm_rf(path)
config.before(:each) do
FileUtils.mkdir_p(builds_path)
end
config.after(:each) do
FileUtils.rm_rf(builds_path)
end
end