lib/rubocop/cop/rspec/receive_never.rb in rubocop-rspec-2.2.0 vs lib/rubocop/cop/rspec/receive_never.rb in rubocop-rspec-2.3.0
- old
+ new
@@ -16,9 +16,10 @@
class ReceiveNever < Base
extend AutoCorrector
MSG = 'Use `not_to receive` instead of `never`.'
RESTRICT_ON_SEND = %i[never].freeze
+ # @!method method_on_stub?(node)
def_node_search :method_on_stub?, '(send nil? :receive ...)'
def on_send(node)
return unless node.method?(:never) && method_on_stub?(node)