From 8e7f5cf82bc5fc9e76536ccc209fd56c45aab441 Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Thu, 1 Nov 2018 20:23:28 -0600 Subject: [PATCH] Capture sample values for tests --- spec/spec_helper.cr | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spec/spec_helper.cr b/spec/spec_helper.cr index 8e9164d..5d98160 100644 --- a/spec/spec_helper.cr +++ b/spec/spec_helper.cr @@ -73,6 +73,14 @@ class SpyExample < Spectator::RunnableExample "SPY" end + # Captures the sample values when the example is created. + def initialize(group, @sample_values) + super(group, @sample_values) + end + + # Sample values given to the example. + getter sample_values : Spectator::Internals::SampleValues + setter block : Proc(Nil)? = nil # Method called by the framework to run the example code.