Ensure harness is reset on error

This commit is contained in:
Michael Miller 2018-10-19 18:52:00 -06:00
parent c48467f783
commit 9cf82928b7

View file

@ -26,9 +26,9 @@ module Spectator::Internals
# The result returned from `Example#run` will be returned. # The result returned from `Example#run` will be returned.
def self.run(example : Example) : Result def self.run(example : Example) : Result
@@current = new(example) @@current = new(example)
result = example.run example.run
ensure
@@current = nil @@current = nil
result
end end
# Retrieves the current running example. # Retrieves the current running example.