lib/rubocop/cop/rspec/hook_argument.rb in rubocop-rspec-1.18.0 vs lib/rubocop/cop/rspec/hook_argument.rb in rubocop-rspec-1.19.0

- old
+ new

@@ -75,11 +75,15 @@ hook(node) do |method_send, scope_name| return correct_style_detected if scope_name.equal?(style) return check_implicit(method_send) unless scope_name style_detected(scope_name) - add_offense(method_send, :expression, explicit_message(scope_name)) + add_offense( + method_send, + location: :expression, + message: explicit_message(scope_name) + ) end end def autocorrect(node) scope = implicit_style? ? '' : "(#{style.inspect})" @@ -93,10 +97,14 @@ def check_implicit(method_send) style_detected(:implicit) return if implicit_style? - add_offense(method_send, :selector, format(EXPLICIT_MSG, style)) + add_offense( + method_send, + location: :selector, + message: format(EXPLICIT_MSG, style) + ) end def explicit_message(scope) if implicit_style? format(IMPLICIT_MSG, scope)