lib/rubocop/cop/rspec/invalid_predicate_matcher.rb in rubocop-rspec-1.41.0 vs lib/rubocop/cop/rspec/invalid_predicate_matcher.rb in rubocop-rspec-1.42.0
- old
+ new
@@ -22,22 +22,19 @@
(send (send nil? :expect ...) #{Runners::ALL.node_pattern_union} $(send nil? #predicate?))
PATTERN
def on_send(node)
invalid_predicate_matcher?(node) do |predicate|
- add_offense(predicate)
+ add_offense(predicate,
+ message: format(MSG, matcher: predicate.method_name))
end
end
private
def predicate?(name)
name = name.to_s
name.start_with?('be_', 'have_') && name.end_with?('?')
- end
-
- def message(predicate)
- format(MSG, matcher: predicate.method_name)
end
end
end
end
end