lib/rubocop/cop/rspec/receive_never.rb in rubocop-rspec-1.42.0 vs lib/rubocop/cop/rspec/receive_never.rb in rubocop-rspec-1.43.0

- old
+ new

@@ -11,17 +11,17 @@ # expect(foo).to receive(:bar).never # # # good # expect(foo).not_to receive(:bar) # - class ReceiveNever < Cop + class ReceiveNever < Base extend AutoCorrector MSG = 'Use `not_to receive` instead of `never`.' def_node_search :method_on_stub?, '(send nil? :receive ...)' def on_send(node) - return unless node.method_name == :never && method_on_stub?(node) + return unless node.method?(:never) && method_on_stub?(node) add_offense(node.loc.selector) do |corrector| autocorrect(corrector, node) end end