New rule: literal in the interpolation

This commit is contained in:
Vitalii Elenhaupt 2017-11-01 14:18:28 +02:00
parent 6a81a648e3
commit 64ccc7448c
No known key found for this signature in database
GPG key ID: 7558EF3A4056C706
5 changed files with 86 additions and 0 deletions

View file

@ -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