mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Fix stub_type when used on a sub-type
previous_def should only be used if the type being stubbed matches the type stub methods are defined in. Re-enable tests for define_subclass mocking.
This commit is contained in:
parent
86b49dc20e
commit
1adcf74c3f
2 changed files with 42 additions and 39 deletions
|
@ -318,7 +318,7 @@ module Spectator
|
|||
{% if method.double_splat %}**{{method.double_splat}}, {% end %}
|
||||
{% if method.block_arg %}&{{method.block_arg}}{% elsif method.accepts_block? %}&{% end %}
|
||||
){% if method.return_type %} : {{method.return_type}}{% end %}{% if !method.free_vars.empty? %} forall {{method.free_vars.splat}}{% end %}
|
||||
previous_def{% if method.accepts_block? %} { |*%yargs| yield *%yargs }{% end %}
|
||||
{% if type == @type %}previous_def{% else %}super{% end %}{% if method.accepts_block? %} { |*%yargs| yield *%yargs }{% end %}
|
||||
end
|
||||
{% end %}
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue