Don't run after hooks if an error occurs

This commit is contained in:
Michael Miller 2018-12-07 23:01:02 -07:00
parent 4222603fea
commit 4e57f6adca

View file

@ -39,13 +39,10 @@ module Spectator
ResultCapture.new.tap do |result| ResultCapture.new.tap do |result|
# Get the proc that will call around-each hooks and the example. # Get the proc that will call around-each hooks and the example.
wrapper = wrap_run_example(result) wrapper = wrap_run_example(result)
begin run_before_hooks
run_before_hooks wrapper.call
wrapper.call run_after_hooks
ensure
run_after_hooks
end
end end
end end