mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
Normalize sources for tests
This commit is contained in:
parent
cb5f802012
commit
d7b0e10d1e
27 changed files with 89 additions and 65 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue