mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
Fix rest of the specs
This commit is contained in:
parent
1cfc926a28
commit
7192b64df0
5 changed files with 4 additions and 4 deletions
|
@ -61,7 +61,7 @@ module Ameba::Rule::Lint
|
|||
issue = s.issues.first
|
||||
|
||||
issue.rule.should_not be_nil
|
||||
issue.location.to_s.should eq "source.cr:2:3"
|
||||
issue.location.to_s.should eq "source.cr:1:1"
|
||||
issue.end_location.to_s.should eq "source.cr:6:3"
|
||||
issue.message.should eq "Empty `ensure` block detected"
|
||||
end
|
||||
|
|
|
@ -166,7 +166,7 @@ module Ameba::Rule::Lint
|
|||
issue = s.issues.first
|
||||
|
||||
issue.rule.should_not be_nil
|
||||
issue.location.to_s.should eq "source.cr:2:3"
|
||||
issue.location.to_s.should eq "source.cr:1:1"
|
||||
issue.end_location.to_s.should eq "source.cr:4:3"
|
||||
issue.message.should eq(
|
||||
"Exception handler has shadowed exceptions: IndexError"
|
||||
|
|
|
@ -95,7 +95,7 @@ module Ameba
|
|||
commented = false
|
||||
|
||||
lexer = Crystal::Lexer.new(line).tap(&.comments_enabled = true)
|
||||
Tokenizer.new(lexer).run { |t| commented = true if t.type == :COMMENT }
|
||||
Tokenizer.new(lexer).run { |t| commented = true if t.type.comment? }
|
||||
commented
|
||||
end
|
||||
end
|
||||
|
|
|
@ -90,7 +90,7 @@ module Ameba::Rule::Style
|
|||
end
|
||||
|
||||
private def redundant_begin_in_expressions?(node)
|
||||
node.keyword == :begin
|
||||
node.keyword == Crystal::Expressions::Keyword::Begin
|
||||
end
|
||||
|
||||
private def inner_handler?(handler)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue