From 4222603fea38cbb1c790dde0c30c3b94595aa945 Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Fri, 7 Dec 2018 22:57:31 -0700 Subject: [PATCH] Don't need reference to result anymore --- src/spectator/runnable_example.cr | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/spectator/runnable_example.cr b/src/spectator/runnable_example.cr index af8623d..85576f9 100644 --- a/src/spectator/runnable_example.cr +++ b/src/spectator/runnable_example.cr @@ -26,7 +26,7 @@ module Spectator end # Runs the hooks that should be performed after the test code finishes. - private def run_after_hooks(result) + private def run_after_hooks group.run_after_hooks rescue ex # If an error occurs in the after hooks, elevate it to abort testing. @@ -39,11 +39,12 @@ module Spectator ResultCapture.new.tap do |result| # Get the proc that will call around-each hooks and the example. wrapper = wrap_run_example(result) + begin run_before_hooks wrapper.call ensure - run_after_hooks(result) + run_after_hooks end end end