From 5d86b4f50e20486b44b96697b3d92bffcaa5773e Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Thu, 12 Sep 2019 20:26:54 -0600 Subject: [PATCH] Get examples working again --- src/spectator/dsl/builder.cr | 4 ++-- src/spectator/dsl/structure_dsl.cr | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/spectator/dsl/builder.cr b/src/spectator/dsl/builder.cr index 569bea5..718191a 100644 --- a/src/spectator/dsl/builder.cr +++ b/src/spectator/dsl/builder.cr @@ -46,8 +46,8 @@ module Spectator::DSL example_type : ::SpectatorTest.class, &runner : ::SpectatorTest ->) : Nil builder = ->{ example_type.new.as(::SpectatorTest) } wrapper = TestWrapper.new(description, source, builder, runner) - example = Example.new(current_group, wrapper) - # TODO: Add to stack. + factory = Builders::ExampleBuilder.new(wrapper) + @@stack.current.add_child(factory) end # Adds a block of code to run before all examples in the current group. diff --git a/src/spectator/dsl/structure_dsl.cr b/src/spectator/dsl/structure_dsl.cr index 05113b6..30a75f5 100644 --- a/src/spectator/dsl/structure_dsl.cr +++ b/src/spectator/dsl/structure_dsl.cr @@ -1424,7 +1424,7 @@ module Spectator::DSL {% end %} {% else %} def %run - {{block}} + {{block.body}} end {% end %}