ConstantNames: correct reported end_location

This commit is contained in:
Vitalii Elenhaupt 2018-11-25 00:37:46 +02:00
parent 9885457227
commit e951c0772a
No known key found for this signature in database
GPG key ID: 7558EF3A4056C706
2 changed files with 2 additions and 2 deletions

View file

@ -43,7 +43,7 @@ module Ameba
issue = s.issues.first
issue.rule.should_not be_nil
issue.location.to_s.should eq "source.cr:1:1"
issue.end_location.to_s.should eq "source.cr:1:9"
issue.end_location.to_s.should eq "source.cr:1:5"
issue.message.should eq(
"Constant name should be screaming-cased: CONST, not Const"
)

View file

@ -38,7 +38,7 @@ module Ameba::Rule::Style
name = target.names.first
return if (expected = name.upcase) == name
issue_for node, MSG % {expected, name}
issue_for target, MSG % {expected, name}
end
end
end