From ca564619ad2ae45f832a058d514298c868fdf699 Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Sat, 1 Jun 2019 20:10:08 -0600 Subject: [PATCH 1/2] Change example wrapper type to a class Fixes issue #11. Variables (defined with let) were getting re-created between the hooks and the example code. This was due to a separate struct value being returned for each fetch to the wrapped example instance. In turn, the wrappers for variables were reset for each fetch. --- src/spectator/dsl/structure_dsl.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/spectator/dsl/structure_dsl.cr b/src/spectator/dsl/structure_dsl.cr index 7f2ccaa..48d6134 100644 --- a/src/spectator/dsl/structure_dsl.cr +++ b/src/spectator/dsl/structure_dsl.cr @@ -1537,7 +1537,7 @@ module Spectator::DSL # The block passed to this macro is the actual test code. private macro _spectator_test(class_name, run_method_name) # Wrapper class for isolating the test code. - struct {{class_name.id}} + class {{class_name.id}} # Mix in methods and macros specifically for example DSL. include ::Spectator::DSL::ExampleDSL From c744120e91b836b11c6dbd8e6d57817aa33aaa98 Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Sat, 1 Jun 2019 20:10:27 -0600 Subject: [PATCH 2/2] Update version to 0.7.2 --- shard.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shard.yml b/shard.yml index 4173544..861b00b 100644 --- a/shard.yml +++ b/shard.yml @@ -1,5 +1,5 @@ name: spectator -version: 0.7.1 +version: 0.7.2 description: | A feature-rich spec testing framework for Crystal with similarities to RSpec.