mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
Rework tests
This commit is contained in:
parent
d20cc212b9
commit
61a45d4321
1 changed files with 9 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue