lib/rubocop/cop/rspec/rails/avoid_setup_hook.rb in rubocop-rspec-2.12.1 vs lib/rubocop/cop/rspec/rails/avoid_setup_hook.rb in rubocop-rspec-2.13.0
- old
+ new
@@ -5,11 +5,10 @@
module RSpec
module Rails
# Checks that tests use RSpec `before` hook over Rails `setup` method.
#
# @example
- #
# # bad
# setup do
# allow(foo).to receive(:bar)
# end
#
@@ -28,10 +27,10 @@
(block
$(send nil? :setup)
(args) _)
PATTERN
- def on_block(node)
+ def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler
setup_call(node) do |setup|
add_offense(node) do |corrector|
corrector.replace setup, 'before'
end
end