From b95cf5693bb5010c1ee5ee12d4dd7bd4fc804399 Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Thu, 24 Oct 2019 20:56:22 -0600 Subject: [PATCH 1/2] Rework let and subject to allow super This addresses https://gitlab.com/arctic-fox/spectator/issues/32 --- src/spectator/dsl/structure_dsl.cr | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/spectator/dsl/structure_dsl.cr b/src/spectator/dsl/structure_dsl.cr index bed9c59..1c9892c 100644 --- a/src/spectator/dsl/structure_dsl.cr +++ b/src/spectator/dsl/structure_dsl.cr @@ -897,7 +897,7 @@ module Spectator::DSL # Block variant. # Create a block that returns the value. - let!(%value) {{block}} + let!({{name.id}}) {{block}} # Wrapper to hold the value. # This will be nil if the value hasn't been referenced yet. @@ -913,12 +913,12 @@ module Spectator::DSL # Unwrap it from the wrapper variable. # Here we use typeof to get around the issue # that the macro has no idea what type the value is. - wrapper.unsafe_as(::Spectator::Internals::TypedValueWrapper(typeof(%value))).value + wrapper.unsafe_as(::Spectator::Internals::TypedValueWrapper(typeof(previous_def))).value else # The value isn't cached, # Construct it and store it in the wrapper. - %value.tap do |value| - @%wrapper = ::Spectator::Internals::TypedValueWrapper(typeof(%value)).new(value) + previous_def.tap do |value| + @%wrapper = ::Spectator::Internals::TypedValueWrapper(typeof(previous_def)).new(value) end end end From af24e5c4cd5e63660b9579dd8c02e676cb6221b7 Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Thu, 24 Oct 2019 20:58:53 -0600 Subject: [PATCH 2/2] Bump version to 0.8.4 --- shard.yml | 4 ++-- src/spectator.cr | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/shard.yml b/shard.yml index fb2bced..f4c31b6 100644 --- a/shard.yml +++ b/shard.yml @@ -1,12 +1,12 @@ name: spectator -version: 0.8.3 +version: 0.8.4 description: | A feature-rich spec testing framework for Crystal with similarities to RSpec. authors: - Michael Miller -crystal: 0.31.0 +crystal: 0.31.1 license: MIT diff --git a/src/spectator.cr b/src/spectator.cr index 5f17921..bf476b6 100644 --- a/src/spectator.cr +++ b/src/spectator.cr @@ -5,7 +5,7 @@ module Spectator extend self # Current version of the Spectator library. - VERSION = "0.8.2" + VERSION = "0.8.4" # Top-level describe method. # All specs in a file must be wrapped in this call.