Rework tests

This commit is contained in:
Vitalii Elenhaupt 2023-02-07 22:20:10 +02:00
parent d20cc212b9
commit 61a45d4321
No known key found for this signature in database
GPG key ID: CD0BF17825928BC0

View file

@ -476,13 +476,18 @@ module Ameba::Rule::Lint
issue.message.should eq "Useless assignment to variable `foo`"
end
it "doesn't report if top level variable defined inside class is referenced" do
it "doesn't report if top level variable defined inside module and referenced" do
s = Source.new %(
class A
module A
foo : String? = "foo"
bar do
foo = "bar"
end
p foo
end
puts foo
)
subject.catch(s).should be_valid
end
@ -492,12 +497,10 @@ module Ameba::Rule::Lint
class A
foo : String? = "foo"
bar do
def method
foo = "bar"
end
end
puts foo
)
subject.catch(s).should be_valid
end