lib/rubocop/cop/rspec/yield.rb in rubocop-rspec-2.2.0 vs lib/rubocop/cop/rspec/yield.rb in rubocop-rspec-2.3.0
- old
+ new
@@ -15,13 +15,16 @@
extend AutoCorrector
include RangeHelp
MSG = 'Use `.and_yield`.'
+ # @!method method_on_stub?(node)
def_node_search :method_on_stub?, '(send nil? :receive ...)'
+ # @!method block_arg(node)
def_node_matcher :block_arg, '(args (blockarg $_))'
+ # @!method block_call?(node)
def_node_matcher :block_call?, '(send (lvar %) :call ...)'
def on_block(node)
return unless method_on_stub?(node.send_node)