2019-07-25 01:27:42 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-03-29 05:47:54 -04:00
|
|
|
require_relative "helpers/stub_configuration"
|
2018-07-23 09:13:11 -04:00
|
|
|
require_relative "helpers/stub_metrics"
|
2018-03-29 05:47:54 -04:00
|
|
|
require_relative "helpers/stub_object_storage"
|
|
|
|
require_relative "helpers/stub_env"
|
2020-07-01 08:09:08 -04:00
|
|
|
require_relative "helpers/fast_rails_root"
|
2020-11-05 13:08:48 -05:00
|
|
|
|
2020-11-09 07:09:24 -05:00
|
|
|
# so we need to load rubocop here due to the rubocop support file loading cop_helper
|
|
|
|
# which monkey patches class Cop
|
|
|
|
# if cop helper is loaded before rubocop (where class Cop is defined as class Cop < Base)
|
|
|
|
# we get a `superclass mismatch for class Cop` error when running a rspec for a locally defined
|
|
|
|
# rubocop cop - therefore we need rubocop required first since it had an inheritance added to the Cop class
|
|
|
|
require 'rubocop'
|
|
|
|
require 'rubocop/rspec/support'
|
2018-03-29 05:47:54 -04:00
|
|
|
|
2022-05-06 08:09:05 -04:00
|
|
|
RSpec::Expectations.configuration.on_potential_false_positives = :raise
|
|
|
|
|
2018-03-29 05:47:54 -04:00
|
|
|
RSpec.configure do |config|
|
2021-11-18 07:13:46 -05:00
|
|
|
config.mock_with :rspec do |mocks|
|
|
|
|
mocks.verify_doubled_constant_names = true
|
|
|
|
end
|
|
|
|
|
2018-03-29 05:47:54 -04:00
|
|
|
config.raise_errors_for_deprecations!
|
|
|
|
|
|
|
|
config.include StubConfiguration
|
2018-07-23 09:13:11 -04:00
|
|
|
config.include StubMetrics
|
2018-03-29 05:47:54 -04:00
|
|
|
config.include StubObjectStorage
|
|
|
|
config.include StubENV
|
2020-07-01 08:09:08 -04:00
|
|
|
config.include FastRailsRoot
|
2020-06-15 20:08:33 -04:00
|
|
|
|
2020-06-22 17:08:42 -04:00
|
|
|
config.include RuboCop::RSpec::ExpectOffense, type: :rubocop
|
2021-01-07 13:10:38 -05:00
|
|
|
|
|
|
|
config.define_derived_metadata(file_path: %r{spec/rubocop}) do |metadata|
|
|
|
|
metadata[:type] = :rubocop
|
|
|
|
end
|
2018-03-29 05:47:54 -04:00
|
|
|
end
|