mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Support mocking modules
This commit is contained in:
parent
6255cc85c4
commit
d378583054
2 changed files with 203 additions and 1 deletions
|
@ -36,7 +36,12 @@ module Spectator
|
|||
macro define_subtype(base, mocked_type, type_name, name = nil, **value_methods, &block)
|
||||
{% begin %}
|
||||
{% if name %}@[::Spectator::StubbedName({{name}})]{% end %}
|
||||
{{base.id}} {{type_name.id}} < {{mocked_type.id}}
|
||||
{% if base.id == :module.id %}
|
||||
{{base.id}} {{type_name.id}}
|
||||
include {{mocked_type.id}}
|
||||
{% else %}
|
||||
{{base.id}} {{type_name.id}} < {{mocked_type.id}}
|
||||
{% end %}
|
||||
include ::Spectator::Mocked
|
||||
extend ::Spectator::StubbedType
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue