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 = s.issues.first
|
||||||
|
|
||||||
issue.rule.should_not be_nil
|
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.end_location.to_s.should eq "source.cr:6:3"
|
||||||
issue.message.should eq "Empty `ensure` block detected"
|
issue.message.should eq "Empty `ensure` block detected"
|
||||||
end
|
end
|
||||||
|
|
|
@ -166,7 +166,7 @@ module Ameba::Rule::Lint
|
||||||
issue = s.issues.first
|
issue = s.issues.first
|
||||||
|
|
||||||
issue.rule.should_not be_nil
|
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.end_location.to_s.should eq "source.cr:4:3"
|
||||||
issue.message.should eq(
|
issue.message.should eq(
|
||||||
"Exception handler has shadowed exceptions: IndexError"
|
"Exception handler has shadowed exceptions: IndexError"
|
||||||
|
|
|
@ -95,7 +95,7 @@ module Ameba
|
||||||
commented = false
|
commented = false
|
||||||
|
|
||||||
lexer = Crystal::Lexer.new(line).tap(&.comments_enabled = true)
|
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
|
commented
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -90,7 +90,7 @@ module Ameba::Rule::Style
|
||||||
end
|
end
|
||||||
|
|
||||||
private def redundant_begin_in_expressions?(node)
|
private def redundant_begin_in_expressions?(node)
|
||||||
node.keyword == :begin
|
node.keyword == Crystal::Expressions::Keyword::Begin
|
||||||
end
|
end
|
||||||
|
|
||||||
private def inner_handler?(handler)
|
private def inner_handler?(handler)
|
||||||
|
|
Loading…
Reference in a new issue