diff --git a/.rubocop_rspec_base.yml b/.rubocop_rspec_base.yml index 2c8a80f3a3..b06c1153ea 100644 --- a/.rubocop_rspec_base.yml +++ b/.rubocop_rspec_base.yml @@ -153,6 +153,9 @@ Style/EmptyMethod: Style/FormatStringToken: Enabled: false +Style/FrozenStringLiteralComment: + Enabled: false + Style/GuardClause: Enabled: false diff --git a/lib/rspec/rails/configuration.rb b/lib/rspec/rails/configuration.rb index c61df85886..73a129e696 100644 --- a/lib/rspec/rails/configuration.rb +++ b/lib/rspec/rails/configuration.rb @@ -54,7 +54,7 @@ def self.add_test_type_configurations(config) end # @private - # rubocop:disable Style/MethodLength + # rubocop:disable Metrics/MethodLength def self.initialize_configuration(config) config.backtrace_exclusion_patterns << /vendor\// config.backtrace_exclusion_patterns << %r{lib/rspec/rails} @@ -146,7 +146,7 @@ def filter_rails_from_backtrace! config.include RSpec::Rails::MailboxExampleGroup, :type => :mailbox end end - # rubocop:enable Style/MethodLength + # rubocop:enable Metrics/MethodLength initialize_configuration RSpec.configuration end diff --git a/lib/rspec/rails/example/mailer_example_group.rb b/lib/rspec/rails/example/mailer_example_group.rb index fe5e6dfa1d..874c773cf7 100644 --- a/lib/rspec/rails/example/mailer_example_group.rb +++ b/lib/rspec/rails/example/mailer_example_group.rb @@ -22,7 +22,7 @@ module MailerExampleGroup included do include ::Rails.application.routes.url_helpers options = ::Rails.configuration.action_mailer.default_url_options - options.each { |key, value| default_url_options[key] = value } if options + options&.each { |key, value| default_url_options[key] = value } end # Class-level DSL for mailer specs. diff --git a/lib/rspec/rails/matchers/active_job.rb b/lib/rspec/rails/matchers/active_job.rb index e489453f5f..90d6a2f07a 100644 --- a/lib/rspec/rails/matchers/active_job.rb +++ b/lib/rspec/rails/matchers/active_job.rb @@ -8,7 +8,7 @@ module Matchers # # @api private module ActiveJob - # rubocop: disable Style/ClassLength + # rubocop: disable Metrics/ClassLength # @private class Base < RSpec::Rails::Matchers::BaseMatcher def initialize @@ -179,7 +179,7 @@ def queue_adapter ::ActiveJob::Base.queue_adapter end end - # rubocop: enable Style/ClassLength + # rubocop: enable Metrics/ClassLength # @private class HaveEnqueuedJob < Base