debian-mirror-gitlab/spec/support/frontend_fixtures.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
480 B
Ruby
Raw Normal View History

2022-01-26 12:08:38 +05:30
# frozen_string_literal: true
return unless ENV['CI']
return unless ENV['GENERATE_FRONTEND_FIXTURES_MAPPING'] == 'true'
RSpec.configure do |config|
config.before(:suite) do
$fixtures_mapping = Hash.new { |h, k| h[k] = [] } # rubocop:disable Style/GlobalVars
end
config.after(:suite) do
next unless ENV['FRONTEND_FIXTURES_MAPPING_PATH']
File.write(ENV['FRONTEND_FIXTURES_MAPPING_PATH'], $fixtures_mapping.to_json) # rubocop:disable Style/GlobalVars
end
end