lib/rubocop/cop/rspec/empty_hook.rb in rubocop-rspec-2.18.1 vs lib/rubocop/cop/rspec/empty_hook.rb in rubocop-rspec-2.19.0
- old
+ new
@@ -29,17 +29,17 @@
MSG = 'Empty hook detected.'
# @!method empty_hook?(node)
def_node_matcher :empty_hook?, <<~PATTERN
- (block $#{send_pattern('#Hooks.all')} _ nil?)
+ (block $(send nil? #Hooks.all ...) _ nil?)
PATTERN
def on_block(node) # rubocop:disable InternalAffairs/NumblockHandler
empty_hook?(node) do |hook|
add_offense(hook) do |corrector|
corrector.remove(
- range_with_surrounding_space(node.loc.expression, side: :left)
+ range_with_surrounding_space(node.source_range, side: :left)
)
end
end
end
end