mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Fix idiosyncrasies around class method stubs
The new method misbehaves here. It always appeared as defined, even though it isn't explicitly defined in the class.
This commit is contained in:
parent
7a8e570bea
commit
2aba67edae
1 changed files with 8 additions and 5 deletions
|
@ -34,16 +34,19 @@ module Spectator::Mocks
|
|||
raise "Unrecognized stub format"
|
||||
end
|
||||
|
||||
original = if @type.methods.find { |m| m.name.id == name }
|
||||
:previous_def
|
||||
else
|
||||
:super
|
||||
end.id
|
||||
t = @type
|
||||
receiver = if receiver == :self.id
|
||||
t = t.class
|
||||
"self."
|
||||
else
|
||||
""
|
||||
end.id
|
||||
original = if (name == :new.id && receiver == "self.".id) ||
|
||||
(t.superclass.has_method?(name) && !t.overrides?(t.superclass, name))
|
||||
:super
|
||||
else
|
||||
:previous_def
|
||||
end.id
|
||||
%}
|
||||
|
||||
{% if body && !body.is_a?(Nop) %}
|
||||
|
|
Loading…
Reference in a new issue