mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
Add additional spec for Lint/NotNil
rule
This commit is contained in:
parent
07ce595ef2
commit
2fb453c61f
1 changed files with 7 additions and 0 deletions
|
@ -18,6 +18,13 @@ module Ameba::Rule::Lint
|
|||
CRYSTAL
|
||||
end
|
||||
|
||||
it "reports if there is a `not_nil!` call in the middle of the call-chain" do
|
||||
expect_issue subject, <<-CRYSTAL
|
||||
(1..3).first?.not_nil!.to_s
|
||||
# ^^^^^^^^ error: Avoid using `not_nil!`
|
||||
CRYSTAL
|
||||
end
|
||||
|
||||
context "macro" do
|
||||
it "doesn't report in macro scope" do
|
||||
expect_no_issues subject, <<-CRYSTAL
|
||||
|
|
Loading…
Reference in a new issue