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

20 lines
436 B
Ruby
Raw Normal View History

2015-08-25 21:42:46 -04:00
RSpec.configure do |config|
def builds_path
2015-09-15 18:00:08 -04:00
Rails.root.join('tmp/builds')
2015-08-25 21:42:46 -04:00
end
config.before(:each) do
FileUtils.mkdir_p(builds_path)
2015-09-15 18:00:08 -04:00
FileUtils.touch(File.join(builds_path, ".gitkeep"))
2015-09-10 09:47:15 -04:00
Settings.gitlab_ci['builds_path'] = builds_path
2015-08-25 21:42:46 -04: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-25 21:42:46 -04:00
end
end
end