Refactor AST::Util#literal? helper

This commit is contained in:
Sijawusz Pur Rahnama 2022-11-15 17:41:37 +01:00
parent cc687d0281
commit 2fb37da80f
4 changed files with 48 additions and 39 deletions

View file

@ -13,10 +13,10 @@ module Ameba::Rule::Lint
CRYSTAL
end
it "reports if there is a regex comparison possibly evaluating to the same" do
it "reports if there is a dynamic comparison possibly evaluating to the same" do
expect_issue subject, <<-CRYSTAL
/foo/ === "foo"
# ^^^^^^^^^^^^^ error: Comparison most likely evaluates to the same
[foo] === ["foo"]
# ^^^^^^^^^^^^^^^ error: Comparison most likely evaluates to the same
CRYSTAL
end