debian-mirror-gitlab/spec/rubocop_spec_helper.rb

28 lines
925 B
Ruby
Raw Normal View History

2022-10-11 01:57:18 +05:30
# frozen_string_literal: true
# All RuboCop specs may use fast_spec_helper.
require 'fast_spec_helper'
# To prevent load order issues we need to require `rubocop` first.
# See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/47008
require 'rubocop'
2023-03-04 22:38:38 +05:30
require 'rubocop/rspec/shared_contexts/default_rspec_language_config_context'
2022-10-11 01:57:18 +05:30
2023-03-04 22:38:38 +05:30
require_relative 'rubocop/support_workaround'
2022-10-11 01:57:18 +05:30
2022-11-25 23:54:43 +05:30
RSpec.configure do |config|
2022-10-11 01:57:18 +05:30
config.define_derived_metadata(file_path: %r{spec/rubocop}) do |metadata|
2023-01-13 00:05:48 +05:30
metadata[:type] = :rubocop
2022-10-11 01:57:18 +05:30
end
2022-11-25 23:54:43 +05:30
config.define_derived_metadata(file_path: %r{spec/rubocop/cop/rspec}) do |metadata|
metadata[:type] = :rubocop_rspec
end
config.include RuboCop::RSpec::ExpectOffense, type: :rubocop
config.include RuboCop::RSpec::ExpectOffense, type: :rubocop_rspec
2022-10-11 01:57:18 +05:30
config.include_context 'config', type: :rubocop
2022-11-25 23:54:43 +05:30
config.include_context 'with default RSpec/Language config', type: :rubocop_rspec
2022-10-11 01:57:18 +05:30
end