lib/rubocop/cop/rspec/let_before_examples.rb in rubocop-rspec-1.32.0 vs lib/rubocop/cop/rspec/let_before_examples.rb in rubocop-rspec-1.33.0
- old
+ new
@@ -32,11 +32,11 @@
# end
class LetBeforeExamples < Cop
include RangeHelp
include RuboCop::RSpec::FinalEndLocation
- MSG = 'Move `let` before the examples in the group.'.freeze
+ MSG = 'Move `let` before the examples in the group.'
def_node_matcher :example_or_group?, <<-PATTERN
{
#{(Examples::ALL + ExampleGroups::ALL).block_pattern}
#{Includes::EXAMPLES.send_pattern}
@@ -89,13 +89,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