gitlab-org--gitlab-foss/spec/support/setup_builds_storage.rb

20 lines
436 B
Ruby
Raw Normal View History

2015-08-26 01:42:46 +00:00
RSpec.configure do |config|
def builds_path
2015-09-15 22:00:08 +00:00
Rails.root.join('tmp/builds')
2015-08-26 01:42:46 +00:00
end
config.before(:each) do
FileUtils.mkdir_p(builds_path)
2015-09-15 22:00:08 +00:00
FileUtils.touch(File.join(builds_path, ".gitkeep"))
2015-09-10 13:47:15 +00:00
Settings.gitlab_ci['builds_path'] = builds_path
2015-08-26 01:42:46 +00:00
end
config.after(:suite) do
Dir[File.join(builds_path, '*')].each do |path|
next if File.basename(path) == '.gitkeep'
FileUtils.rm_rf(path)
2015-08-26 01:42:46 +00:00
end
end
end