mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Use absolute path for inject_mock
This is necessary to override the original type instead of creating a new one within the spec.
This commit is contained in:
parent
da3fbc9607
commit
ac3b322900
2 changed files with 2 additions and 2 deletions
|
@ -420,7 +420,7 @@ module Spectator::DSL
|
|||
# This isn't required, but new_mock() should still find this type.
|
||||
::Spectator::DSL::Mocks::TYPES << {type.id.symbolize, @type.name(generic_args: false).symbolize, resolved.name.symbolize} %}
|
||||
|
||||
::Spectator::Mock.inject({{base}}, {{type.id}}, {{**value_methods}}) {{block}}
|
||||
::Spectator::Mock.inject({{base}}, ::{{resolved.name}}, {{**value_methods}}) {{block}}
|
||||
end
|
||||
|
||||
# Targets a stubbable object (such as a mock or double) for operations.
|
||||
|
|
|
@ -115,7 +115,7 @@ module Spectator
|
|||
macro inject(base, type_name, name = nil, **value_methods, &block)
|
||||
{% begin %}
|
||||
{% if name %}@[::Spectator::StubbedName({{name}})]{% end %}
|
||||
{{base.id}} {{type_name.id}}
|
||||
{{base.id}} ::{{type_name.id}}
|
||||
include ::Spectator::Mocked
|
||||
extend ::Spectator::StubbedType
|
||||
|
||||
|
|
Loading…
Reference in a new issue