Skip to content

address rubocop offenses: #2126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What versions of Ruby does that operator support?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

>= 2.3.. v4 will drop support for ruby below 2.3, so using lonely operator should be safe..

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