lib/rubocop/cop/rspec/expect_in_hook.rb in rubocop-rspec-2.2.0 vs lib/rubocop/cop/rspec/expect_in_hook.rb in rubocop-rspec-2.3.0
- old
+ new
@@ -21,9 +21,10 @@
# expect(something).to eq 'foo'
# end
class ExpectInHook < Base
MSG = 'Do not use `%<expect>s` in `%<hook>s` hook'
+ # @!method expectation(node)
def_node_search :expectation, send_pattern('#Expectations.all')
def on_block(node)
return unless hook?(node)
return if node.body.nil?