gitlab-org--gitlab-foss/spec/support/setup_builds_storage.rb
Yorick Peterse dbc05d4a62 Don't use "rm" for cleaning tmp/builds
If this directory were to be empty this would result in warnings being
printed to STDERR, cluttering spec output. Doing this in Ruby fixes this
problem (and also removes the need for shell alltogether).
2015-10-02 16:25:47 +02:00

19 lines
436 B
Ruby

RSpec.configure do |config|
def builds_path
Rails.root.join('tmp/builds')
end
config.before(:each) do
FileUtils.mkdir_p(builds_path)
FileUtils.touch(File.join(builds_path, ".gitkeep"))
Settings.gitlab_ci['builds_path'] = builds_path
end
config.after(:suite) do
Dir[File.join(builds_path, '*')].each do |path|
next if File.basename(path) == '.gitkeep'
FileUtils.rm_rf(path)
end
end
end