spec/support/expect_violation.rb in rubocop-rspec-1.8.0 vs spec/support/expect_violation.rb in rubocop-rspec-1.9.0
- old
+ new
@@ -27,13 +27,15 @@
end
private
def to_assertion(offense)
+ highlight = offense.highlighted_area
+
Expectation::Assertion.new(
message: offense.message,
- line_number: offense.location.line,
- column_range: offense.location.column_range
+ line_number: offense.location.first_line,
+ column_range: highlight.begin_pos...highlight.end_pos
)
end
class Expectation
VIOLATION_LINE_PATTERN = /\A *\^/