From 43440d37b00fc91121ddf9b63394622e96b926bb Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Sat, 17 Aug 2019 07:59:32 -0600 Subject: [PATCH] Explicit initializer with sample values Not sure why it isn't getting the one from the module. --- src/spectator/dsl/structure_dsl.cr | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/spectator/dsl/structure_dsl.cr b/src/spectator/dsl/structure_dsl.cr index 176d358..8433029 100644 --- a/src/spectator/dsl/structure_dsl.cr +++ b/src/spectator/dsl/structure_dsl.cr @@ -511,6 +511,13 @@ module Spectator::DSL # Include the parent module. include {{@type.id}} + # 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) + super + end + # Method that returns an array containing the collection. # This method should be called only once. # The framework stores the collection as an array for a couple of reasons.