lib/rubocop/cop/style/implicit_runtime_error.rb in rubocop-0.50.0 vs lib/rubocop/cop/style/implicit_runtime_error.rb in rubocop-0.51.0
- old
+ new
@@ -17,14 +17,14 @@
class ImplicitRuntimeError < Cop
MSG = 'Use `%s` with an explicit exception class and message, ' \
'rather than just a message.'.freeze
def_node_matcher :implicit_runtime_error_raise_or_fail,
- '(send nil ${:raise :fail} {str dstr})'
+ '(send nil? ${:raise :fail} {str dstr})'
def on_send(node)
implicit_runtime_error_raise_or_fail(node) do |method|
- add_offense(node, :expression, format(MSG, method))
+ add_offense(node, message: format(MSG, method))
end
end
end
end
end