Use previous_def if method was defined in class

This commit is contained in:
Michael Miller 2021-07-02 21:01:41 -06:00
parent a0537484f4
commit 83ab5f56f0
No known key found for this signature in database
GPG key ID: FB9F12F7C646A4AD

View file

@ -59,8 +59,10 @@ module Spectator::Mocks
original = if (name == :new.id && receiver == "self.".id) ||
(t.superclass && t.superclass.has_method?(name) && !t.overrides?(t.superclass, name))
:super
else
elsif t.has_method?(name)
:previous_def
else
"::#{name}"
end.id
%}