Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit bb731e2

Browse files
committed
Merge pull request #868 from zsyed91/refactor_built_in_base_matcher
Fix rubocop issues in base_matcher
2 parents 4d24905 + 6c38911 commit bb731e2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/rspec/matchers/built_in/base_matcher.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ module BuiltIn
88
#
99
# ### Warning:
1010
#
11-
# This class is for internal use, and subject to change without notice. We
12-
# strongly recommend that you do not base your custom matchers on this
11+
# This class is for internal use, and subject to change without notice.
12+
# We strongly recommend that you do not base your custom matchers on this
1313
# class. If/when this changes, we will announce it and remove this warning.
1414
class BaseMatcher
1515
include RSpec::Matchers::Composable
@@ -92,7 +92,7 @@ def actual_formatted
9292

9393
# @private
9494
def self.matcher_name
95-
@matcher_name ||= underscore(name.split("::").last)
95+
@matcher_name ||= underscore(name.split('::').last)
9696
end
9797

9898
# @private
@@ -101,7 +101,7 @@ def self.underscore(camel_cased_word)
101101
word = camel_cased_word.to_s.dup
102102
word.gsub!(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
103103
word.gsub!(/([a-z\d])([A-Z])/, '\1_\2')
104-
word.tr!("-", "_")
104+
word.tr!('-', '_')
105105
word.downcase!
106106
word
107107
end
@@ -118,7 +118,7 @@ def assert_ivars(*expected_ivars)
118118
if RUBY_VERSION.to_f < 1.9
119119
# :nocov:
120120
def present_ivars
121-
instance_variables.map { |v| v.to_sym }
121+
instance_variables.map(&:to_sym)
122122
end
123123
# :nocov:
124124
else
@@ -168,7 +168,7 @@ def failure_message_when_negated
168168
# @private
169169
def self.has_default_failure_messages?(matcher)
170170
matcher.method(:failure_message).owner == self &&
171-
matcher.method(:failure_message_when_negated).owner == self
171+
matcher.method(:failure_message_when_negated).owner == self
172172
rescue NameError
173173
false
174174
end

0 commit comments

Comments
 (0)