Capture harness in spy example

This commit is contained in:
Michael Miller 2018-11-14 12:58:32 -07:00
parent 4a531bd83f
commit 49deb96a11

View file

@ -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