Rework variable references detection in macro

This commit is contained in:
Vitalii Elenhaupt 2018-05-12 20:06:52 +03:00
parent efe67212b0
commit bf907ee98b
No known key found for this signature in database
GPG key ID: 7558EF3A4056C706
4 changed files with 37 additions and 9 deletions

View file

@ -851,6 +851,22 @@ module Ameba::Rule
)
subject.catch(s).should_not be_valid
end
it "doesn't report if assignment is referenced in a macro below" do
s = Source.new %(
class Foo
def foo
a = 1
macro_call
end
macro macro_call
puts a
end
end
)
subject.catch(s).should be_valid
end
end
context "uninitialized" do