mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Rename Proxy to Wrapper
This commit is contained in:
parent
a0fbc61244
commit
5eb5561e61
3 changed files with 7 additions and 7 deletions
|
@ -52,14 +52,14 @@ module Spectator
|
|||
let!({{name}}!) {{block}}
|
||||
|
||||
module Context
|
||||
@_%proxy : ValueProxy?
|
||||
@_%wrapper : ValueWrapper?
|
||||
|
||||
def {{name.id}}
|
||||
if (proxy = @_%proxy)
|
||||
proxy.as(TypedValueProxy(typeof({{name.id}}!))).value
|
||||
if (wrapper = @_%wrapper)
|
||||
wrapper.as(TypedValueWrapper(typeof({{name.id}}!))).value
|
||||
else
|
||||
{{name.id}}!.tap do |value|
|
||||
@_%proxy = TypedValueProxy(typeof({{name.id}}!)).new(value)
|
||||
@_%wrapper = TypedValueWrapper(typeof({{name.id}}!)).new(value)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require "./value_proxy"
|
||||
require "./value_wrapper"
|
||||
|
||||
module Spectator
|
||||
class TypedValueProxy(T) < ValueProxy
|
||||
class TypedValueWrapper(T) < ValueWrapper
|
||||
getter value : T
|
||||
|
||||
def initialize(@value : T)
|
|
@ -2,7 +2,7 @@ module Spectator
|
|||
# Base class for proxying test values to examples.
|
||||
# This abstraction is required for inferring types.
|
||||
# The `DSL#let` macro makes heavy use of this.
|
||||
private abstract class ValueProxy
|
||||
private abstract class ValueWrapper
|
||||
# Retrieves the underlying value.
|
||||
abstract def value
|
||||
end
|
Loading…
Reference in a new issue