Normalize sources for tests

This commit is contained in:
Vitalii Elenhaupt 2018-09-07 15:07:03 +03:00
parent cb5f802012
commit d7b0e10d1e
No known key found for this signature in database
GPG key ID: 7558EF3A4056C706
27 changed files with 89 additions and 65 deletions

View file

@ -56,8 +56,8 @@ module Ameba::Rule::Performance
issue = s.issues.first
issue.rule.should_not be_nil
issue.location.to_s.should eq "source.cr:2:19"
issue.end_location.to_s.should eq "source.cr:2:44"
issue.location.to_s.should eq "source.cr:1:11"
issue.end_location.to_s.should eq "source.cr:1:36"
issue.message.should eq "Use `any? {...}` instead of `reject {...}.any?`"
end
end

View file

@ -71,8 +71,8 @@ module Ameba::Rule::Performance
issue = s.issues.first
issue.rule.should_not be_nil
issue.location.to_s.should eq "source.cr:2:19"
issue.end_location.to_s.should eq "source.cr:2:45"
issue.location.to_s.should eq "source.cr:1:11"
issue.end_location.to_s.should eq "source.cr:1:37"
issue.message.should eq "Use `find {...}` instead of `select {...}.first`"
end
@ -86,8 +86,8 @@ module Ameba::Rule::Performance
issue = s.issues.first
issue.rule.should_not be_nil
issue.location.to_s.should eq "source.cr:2:19"
issue.end_location.to_s.should eq "source.cr:2:46"
issue.location.to_s.should eq "source.cr:1:11"
issue.end_location.to_s.should eq "source.cr:1:38"
issue.message.should eq "Use `find {...}` instead of `select {...}.first?`"
end
@ -101,8 +101,8 @@ module Ameba::Rule::Performance
issue = s.issues.first
issue.rule.should_not be_nil
issue.location.to_s.should eq "source.cr:2:19"
issue.end_location.to_s.should eq "source.cr:2:44"
issue.location.to_s.should eq "source.cr:1:11"
issue.end_location.to_s.should eq "source.cr:1:36"
issue.message.should eq "Use `reverse_each.find {...}` instead of `select {...}.last`"
end
@ -116,8 +116,8 @@ module Ameba::Rule::Performance
issue = s.issues.first
issue.rule.should_not be_nil
issue.location.to_s.should eq "source.cr:2:19"
issue.end_location.to_s.should eq "source.cr:2:45"
issue.location.to_s.should eq "source.cr:1:11"
issue.end_location.to_s.should eq "source.cr:1:37"
issue.message.should eq "Use `reverse_each.find {...}` instead of `select {...}.last?`"
end

View file

@ -57,8 +57,8 @@ module Ameba::Rule::Performance
issue = s.issues.first
issue.rule.should_not be_nil
issue.location.to_s.should eq "source.cr:2:4"
issue.end_location.to_s.should eq "source.cr:2:25"
issue.location.to_s.should eq "source.cr:1:4"
issue.end_location.to_s.should eq "source.cr:1:25"
issue.message.should eq "Use `count {...}` instead of `reject {...}.size`."
end
end