Don't run deferred blocks if the test fails

This also prevents overriding the test's original error with on that may 
occur in the deferred blocks.
This commit is contained in:
Michael Miller 2019-11-16 09:06:47 -07:00
parent 23d8f4b5a6
commit c9fb4d2d33

View file

@ -20,7 +20,7 @@ module Spectator
context.run_before_hooks(self) context.run_before_hooks(self)
run_example(result) run_example(result)
context.run_after_hooks(self) context.run_after_hooks(self)
run_deferred(result) run_deferred(result) unless result.error
end end
end end