diff --git a/src/spectator.cr b/src/spectator.cr index c00c080..671fadd 100644 --- a/src/spectator.cr +++ b/src/spectator.cr @@ -41,6 +41,12 @@ module Spectator # Include the DSL for creating groups, example, and more. include ::Spectator::DSL::StructureDSL + # Placeholder initializer. + # This is needed because examples and groups call super in their initializer. + # Those initializers pass the sample values upward through their hierarchy. + def initialize(_sample_values : ::Spectator::Internals::SampleValues) + end + # Pass off the "what" argument and block to `DSL::StructureDSL.describe`. # That method will handle creating a new group for this spec. describe({{what}}) {{block}} diff --git a/src/spectator/dsl/structure_dsl.cr b/src/spectator/dsl/structure_dsl.cr index 8010d30..10e59e6 100644 --- a/src/spectator/dsl/structure_dsl.cr +++ b/src/spectator/dsl/structure_dsl.cr @@ -151,12 +151,6 @@ module Spectator::DSL # Sample values are a collection of test values that can be used in examples. # For more information, see `Internals::SampleValues`. module StructureDSL - # Placeholder initializer. - # This is needed because examples and groups call super in their initializer. - # Those initializers pass the sample values upward through their hierarchy. - def initialize(sample_values : Internals::SampleValues) - end - # Creates a new example group to describe a component. # The *what* argument describes "what" is being tested. # Additional example groups and DSL may be nested in the block.