lib/rubocop/cop/rspec/leading_subject.rb in rubocop-rspec-1.21.0 vs lib/rubocop/cop/rspec/leading_subject.rb in rubocop-rspec-1.22.0
- old
+ new
@@ -60,17 +60,10 @@
def find_first_let(node)
node.parent.children.find { |sibling| let?(sibling) }
end
def node_range(node)
- range = node.source_range
- range = range_with_surrounding_space(
- range: range, side: :left, newlines: false
- )
- range = range_with_surrounding_space(
- range: range, side: :right, newlines: true
- )
- range
+ range_by_whole_lines(node.source_range, include_final_newline: true)
end
def in_spec_block?(node)
node.each_ancestor(:block).any? do |ancestor|
Examples::ALL.include?(ancestor.method_name)