Backward compatibility to Crystal 1.3

This commit is contained in:
Vitalii Elenhaupt 2022-04-03 19:17:47 +03:00
parent 7192b64df0
commit 087f470f15
No known key found for this signature in database
GPG key ID: CD0BF17825928BC0
7 changed files with 94 additions and 12 deletions

View file

@ -61,7 +61,9 @@ module Ameba::Rule::Lint
issue = s.issues.first
issue.rule.should_not be_nil
issue.location.to_s.should eq "source.cr:1:1"
# TODO: refactor this in next release
# Crystal 1.4 changes the start location of Crystal::ExceptionHandler
# issue.location.to_s.should eq "source.cr:2:3"
issue.end_location.to_s.should eq "source.cr:6:3"
issue.message.should eq "Empty `ensure` block detected"
end

View file

@ -166,7 +166,9 @@ module Ameba::Rule::Lint
issue = s.issues.first
issue.rule.should_not be_nil
issue.location.to_s.should eq "source.cr:1:1"
# TODO: refactor this in next release
# Crystal 1.4 changes the start location of Crystal::ExceptionHandler
# issue.location.to_s.should eq "source.cr:2:3"
issue.end_location.to_s.should eq "source.cr:4:3"
issue.message.should eq(
"Exception handler has shadowed exceptions: IndexError"