From 87d9cc438f510c912ad4a5b7debd115374b912ac Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Sun, 23 Sep 2018 12:02:51 -0600 Subject: [PATCH] Move code for root back to Spectator#describe There seems to be a problem using def in block. This broke helper methods and gives the error: `can't declare def dynamically`. --- src/spectator.cr | 6 +++++- src/spectator/dsl.cr | 7 ------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/spectator.cr b/src/spectator.cr index 2e39c04..302ed0d 100644 --- a/src/spectator.cr +++ b/src/spectator.cr @@ -5,7 +5,11 @@ module Spectator VERSION = "0.1.0" macro describe(what, &block) - DSL.root({{what}}) {{block}} + module SpectatorExamples + include ::Spectator::DSL::StructureDSL + + describe({{what}}) {{block}} + end end at_exit do diff --git a/src/spectator/dsl.cr b/src/spectator/dsl.cr index 63ad5f8..43047f3 100644 --- a/src/spectator/dsl.cr +++ b/src/spectator/dsl.cr @@ -2,12 +2,5 @@ require "./dsl/*" module Spectator module DSL - macro root(what, &block) - module SpectatorExamples - include StructureDSL - - describe({{what}}) {{block}} - end - end end end