diff --git a/spec/ameba/rule/style/constant_names_spec.cr b/spec/ameba/rule/style/constant_names_spec.cr index b086288b..fa81c1e0 100644 --- a/spec/ameba/rule/style/constant_names_spec.cr +++ b/spec/ameba/rule/style/constant_names_spec.cr @@ -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" ) diff --git a/src/ameba/rule/style/constant_names.cr b/src/ameba/rule/style/constant_names.cr index fcfd821f..151cfa9a 100644 --- a/src/ameba/rule/style/constant_names.cr +++ b/src/ameba/rule/style/constant_names.cr @@ -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