Skip to content

Commit ec87f4b

Browse files
ignatiusrezabenoittgt
authored andcommitted
address rubocop offenses: (#2126)
- fix warnings for wrong namespaces - fix safe navigation offense - turn off frozen string literal cop
1 parent 9143a27 commit ec87f4b

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

.rubocop_rspec_base.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,9 @@ Style/EmptyMethod:
153153
Style/FormatStringToken:
154154
Enabled: false
155155

156+
Style/FrozenStringLiteralComment:
157+
Enabled: false
158+
156159
Style/GuardClause:
157160
Enabled: false
158161

lib/rspec/rails/configuration.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def self.add_test_type_configurations(config)
5454
end
5555

5656
# @private
57-
# rubocop:disable Style/MethodLength
57+
# rubocop:disable Metrics/MethodLength
5858
def self.initialize_configuration(config)
5959
config.backtrace_exclusion_patterns << /vendor\//
6060
config.backtrace_exclusion_patterns << %r{lib/rspec/rails}
@@ -146,7 +146,7 @@ def filter_rails_from_backtrace!
146146
config.include RSpec::Rails::MailboxExampleGroup, :type => :mailbox
147147
end
148148
end
149-
# rubocop:enable Style/MethodLength
149+
# rubocop:enable Metrics/MethodLength
150150

151151
initialize_configuration RSpec.configuration
152152
end

lib/rspec/rails/example/mailer_example_group.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module MailerExampleGroup
2222
included do
2323
include ::Rails.application.routes.url_helpers
2424
options = ::Rails.configuration.action_mailer.default_url_options
25-
options.each { |key, value| default_url_options[key] = value } if options
25+
options&.each { |key, value| default_url_options[key] = value }
2626
end
2727

2828
# Class-level DSL for mailer specs.

lib/rspec/rails/matchers/active_job.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module Matchers
88
#
99
# @api private
1010
module ActiveJob
11-
# rubocop: disable Style/ClassLength
11+
# rubocop: disable Metrics/ClassLength
1212
# @private
1313
class Base < RSpec::Rails::Matchers::BaseMatcher
1414
def initialize
@@ -179,7 +179,7 @@ def queue_adapter
179179
::ActiveJob::Base.queue_adapter
180180
end
181181
end
182-
# rubocop: enable Style/ClassLength
182+
# rubocop: enable Metrics/ClassLength
183183

184184
# @private
185185
class HaveEnqueuedJob < Base

0 commit comments

Comments
 (0)