Skip to content

Commit

Permalink
address rubocop offenses: (#2126)
Browse files Browse the repository at this point in the history
- fix warnings for wrong namespaces
- fix safe navigation offense
- turn off frozen string literal cop
  • Loading branch information
ignatiusreza authored and JonRowe committed May 14, 2019
1 parent 9555946 commit f970835
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .rubocop_rspec_base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ Style/EmptyMethod:
Style/FormatStringToken:
Enabled: false

Style/FrozenStringLiteralComment:
Enabled: false

Style/GuardClause:
Enabled: false

Expand Down
4 changes: 2 additions & 2 deletions lib/rspec/rails/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/rspec/rails/example/mailer_example_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions lib/rspec/rails/matchers/active_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f970835

Please sign in to comment.