Welcome to mirror list, hosted at ThFree Co, Russian Federation.

rubocop_spec_helper.rb « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: cf747132ec150be26fb16d02435b52cc6d448985 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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'
require 'rubocop/rspec/support'

require_relative './support/shared_contexts/rubocop_default_rspec_language_config_context'

RSpec.configure do |config|
  config.define_derived_metadata(file_path: %r{spec/rubocop}) do |metadata|
    # TODO: move DuplicateSpecLocation cop to RSpec::DuplicateSpecLocation
    unless metadata[:type] == :rubocop_rspec
      metadata[:type] = :rubocop
    end
  end

  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

  config.include_context 'config', type: :rubocop
  config.include_context 'with default RSpec/Language config', type: :rubocop_rspec
end