From 0706a9986c0ae5c2755aa4a48def12968d53eec3 Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Fri, 6 Sep 2019 13:08:41 -0600 Subject: [PATCH] Ensure example is set to finished after running --- src/spectator/example.cr | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/spectator/example.cr b/src/spectator/example.cr index d8185ef..934931a 100644 --- a/src/spectator/example.cr +++ b/src/spectator/example.cr @@ -22,8 +22,9 @@ module Spectator # An exception is raised if an attempt is made to run it more than once. def run : Result raise "Attempted to run example more than once (#{self})" if finished? - @finished = true run_impl + ensure + @finished = true end # Implementation-specific for running the example code.