lib/rubocop/cop/rspec/expect_in_hook.rb in rubocop-rspec-2.31.0 vs lib/rubocop/cop/rspec/expect_in_hook.rb in rubocop-rspec-3.0.0.pre
- old
+ new
@@ -25,10 +25,10 @@
MSG = 'Do not use `%<expect>s` in `%<hook>s` hook'
# @!method expectation(node)
def_node_search :expectation, '(send nil? #Expectations.all ...)'
- def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler
+ def on_block(node)
return unless hook?(node)
return if node.body.nil?
expectation(node.body) do |expect|
add_offense(expect.loc.selector,