We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents cd6a30e + abc465e commit 74b8747Copy full SHA for 74b8747
lib/rubocop/cop/rspec/predicate_matcher.rb
@@ -74,7 +74,7 @@ def to_predicate_matcher(name)
74
name[0..-2]
75
when 'exist?', 'exists?'
76
'exist'
77
- when /^has_/
+ when /\Ahas_/
78
name.sub('has_', 'have_')[0..-2]
79
else
80
"be_#{name[0..-2]}"
@@ -240,10 +240,10 @@ def to_predicate_method(matcher)
240
'include?'
241
when 'respond_to'
242
'respond_to?'
243
- when /^have_(.+)/
+ when /\Ahave_(.+)/
244
"has_#{Regexp.last_match(1)}?"
245
246
- "#{matcher[/^be_(.+)/, 1]}?"
+ "#{matcher[/\Abe_(.+)/, 1]}?"
247
end
248
249
# rubocop:enable Metrics/MethodLength
0 commit comments