Track issue.end_location properly

This commit is contained in:
Vitalii Elenhaupt 2018-11-24 19:38:13 +02:00
parent ad2c6bad0e
commit 9885457227
No known key found for this signature in database
GPG key ID: 7558EF3A4056C706
45 changed files with 90 additions and 20 deletions

View file

@ -27,6 +27,7 @@ module Ameba::Rule::Layout
issue = source.issues.first
issue.rule.should eq subject
issue.location.to_s.should eq "source.cr:1:#{subject.max_length + 1}"
issue.end_location.should be_nil
issue.message.should eq "Line too long"
end

View file

@ -31,6 +31,7 @@ module Ameba::Rule::Layout
issue = source.issues.first
issue.rule.should_not be_nil
issue.location.to_s.should eq "source.cr:3:1"
issue.end_location.should be_nil
issue.message.should eq "Blank lines detected at the end of the file"
end
end

View file

@ -21,6 +21,7 @@ module Ameba::Rule::Layout
issue = source.issues.first
issue.rule.should_not be_nil
issue.location.to_s.should eq "source.cr:2:7"
issue.end_location.should be_nil
issue.message.should eq "Trailing whitespace detected"
end
end