From 5eb5561e61eb72855b381554628319e9f4bef238 Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Thu, 30 Aug 2018 14:07:46 -0600 Subject: [PATCH] Rename Proxy to Wrapper --- src/spectator/dsl.cr | 8 ++++---- .../{typed_value_proxy.cr => typed_value_wrapper.cr} | 4 ++-- src/spectator/{value_proxy.cr => value_wrapper.cr} | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) rename src/spectator/{typed_value_proxy.cr => typed_value_wrapper.cr} (55%) rename src/spectator/{value_proxy.cr => value_wrapper.cr} (86%) diff --git a/src/spectator/dsl.cr b/src/spectator/dsl.cr index 5061138..3500f3a 100644 --- a/src/spectator/dsl.cr +++ b/src/spectator/dsl.cr @@ -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 diff --git a/src/spectator/typed_value_proxy.cr b/src/spectator/typed_value_wrapper.cr similarity index 55% rename from src/spectator/typed_value_proxy.cr rename to src/spectator/typed_value_wrapper.cr index 8254c4b..6d3507f 100644 --- a/src/spectator/typed_value_proxy.cr +++ b/src/spectator/typed_value_wrapper.cr @@ -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) diff --git a/src/spectator/value_proxy.cr b/src/spectator/value_wrapper.cr similarity index 86% rename from src/spectator/value_proxy.cr rename to src/spectator/value_wrapper.cr index 438332d..d84a39e 100644 --- a/src/spectator/value_proxy.cr +++ b/src/spectator/value_wrapper.cr @@ -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