From 0992bad7eb92ba24970a0e45b12b982c7cd15e63 Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Sat, 16 Jan 2021 11:03:05 -0700 Subject: [PATCH] Get harness compiling again --- src/spectator/harness.cr | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/spectator/harness.cr b/src/spectator/harness.cr index 37bf1eb..2b42c8f 100644 --- a/src/spectator/harness.cr +++ b/src/spectator/harness.cr @@ -15,18 +15,20 @@ module Spectator # This sets up the harness so that the test code can use it. # The framework does the following: # ``` - # result = Harness.run { delegate.call(example) } + # result = Harness.run { run_example_code } # # Do something with the result. # ``` + # # Then from the test code, the harness can be accessed via `.current` like so: # ``` # harness = ::Spectator::Harness.current # # Do something with the harness. # ``` + # # Of course, the end-user shouldn't see this or work directly with the harness. - # Instead, methods the user calls can access it. - # For instance, an assertion reporting a result. - private class Harness + # Instead, methods the test calls can access it. + # For instance, an expectation reporting a result. + class Harness # Retrieves the harness for the current running example. class_getter! current : self @@ -54,6 +56,10 @@ module Spectator translate(*outcome) end + def report(expectation) + # TODO + end + # Stores a block of code to be executed later. # All deferred blocks run just before the `#run` method completes. def defer(&block) : Nil