From 49deb96a11ad2a5a80c51b43acb7b948585e3a1d Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Wed, 14 Nov 2018 12:58:32 -0700 Subject: [PATCH] Capture harness in spy example --- spec/helpers/spy_example.cr | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spec/helpers/spy_example.cr b/spec/helpers/spy_example.cr index 988243b..626f3ce 100644 --- a/spec/helpers/spy_example.cr +++ b/spec/helpers/spy_example.cr @@ -14,10 +14,14 @@ class SpyExample < Spectator::RunnableExample # Sample values given to the example. getter sample_values : Spectator::Internals::SampleValues + # Harness that was used while running the example. + getter! harness : Spectator::Internals::Harness + setter block : Proc(Nil)? = nil # Method called by the framework to run the example code. private def run_instance + @harness = Spectator::Internals::Harness.current if block = @block block.call end