lib/rubocop/cop/rspec/hooks_before_examples.rb in rubocop-rspec-1.32.0 vs lib/rubocop/cop/rspec/hooks_before_examples.rb in rubocop-rspec-1.33.0

- old
+ new

@@ -25,11 +25,11 @@ # class HooksBeforeExamples < Cop include RangeHelp include RuboCop::RSpec::FinalEndLocation - MSG = 'Move `%<hook>s` above the examples in the group.'.freeze + MSG = 'Move `%<hook>s` above the examples in the group.' def_node_matcher :example_or_group?, <<-PATTERN { #{(Examples::ALL + ExampleGroups::ALL).block_pattern} #{Includes::EXAMPLES.send_pattern} @@ -86,13 +86,10 @@ def source(node) node_range(node).source end def node_range(node) - range_between( - node.loc.expression.begin_pos, - final_end_location(node).end_pos - ) + node.loc.expression.with(end_pos: final_end_location(node).end_pos) end end end end end