mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
New rule: literal in the interpolation
This commit is contained in:
parent
6a81a648e3
commit
64ccc7448c
5 changed files with 86 additions and 0 deletions
|
|
@ -35,5 +35,15 @@ module Ameba::AST
|
|||
subject.literal?(Crystal::Nop).should be_false
|
||||
end
|
||||
end
|
||||
|
||||
describe "#string_literal?" do
|
||||
it "returns true if node is a string literal" do
|
||||
subject.string_literal?(Crystal::StringLiteral.new "").should be_true
|
||||
end
|
||||
|
||||
it "returns false if node is not a string literal" do
|
||||
subject.string_literal?(Crystal::Nop.new).should be_false
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue