From 4ecc2c600416acc58f85b3a5344e238a168907ab Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Fri, 30 Aug 2019 13:14:48 -0600 Subject: [PATCH] Include ExampleDSL at root Will need to check if methods can run in that scope. --- src/spectator.cr | 4 ++-- src/spectator/dsl/structure_dsl.cr | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/spectator.cr b/src/spectator.cr index aa590d8..cf21730 100644 --- a/src/spectator.cr +++ b/src/spectator.cr @@ -38,8 +38,8 @@ module Spectator # Root-level class that contains all examples and example groups. class SpectatorExamples - # Include the DSL for creating groups, example, and more. - include ::Spectator::DSL::StructureDSL + include ::Spectator::DSL::StructureDSL # Include the DSL for creating groups, example, and more. + include ::Spectator::DSL::ExampleDSL # Mix in methods and macros specifically for example DSL. # Placeholder initializer. # This is needed because examples and groups call super in their initializer. diff --git a/src/spectator/dsl/structure_dsl.cr b/src/spectator/dsl/structure_dsl.cr index 1d3b421..df9d5e6 100644 --- a/src/spectator/dsl/structure_dsl.cr +++ b/src/spectator/dsl/structure_dsl.cr @@ -241,7 +241,6 @@ module Spectator::DSL # Class for the context. # The class uses a generated unique name. class Context%context < {{@type.id}} - # Check if `what` looks like a type. # If it is, add the `#described_class` and `subject` methods. # At the time of writing this code, @@ -1577,9 +1576,6 @@ module Spectator::DSL private macro _spectator_test(class_name, run_method_name) # Wrapper class for isolating the test code. class {{class_name.id}} < {{@type.id}} - # Mix in methods and macros specifically for example DSL. - include ::Spectator::DSL::ExampleDSL - # Initializer that accepts sample values. # The sample values are passed upward to the group modules. # Any module that adds sample values can pull their values from this instance.