mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
parent
00045ba9be
commit
8480349ff0
3 changed files with 9 additions and 5 deletions
|
@ -157,9 +157,10 @@ module Spectator
|
|||
# The hooks will be run only once,
|
||||
# and only after all examples in the group have finished.
|
||||
# Subsequent calls after the hooks have been run will do nothing.
|
||||
protected def run_after_all_hooks : Nil
|
||||
protected def run_after_all_hooks(ignore_unfinished = false) : Nil
|
||||
return if @after_all_hooks_run
|
||||
return unless finished?
|
||||
return unless ignore_unfinished || finished?
|
||||
|
||||
@hooks.run_after_all
|
||||
@after_all_hooks_run = true
|
||||
end
|
||||
|
|
|
@ -51,9 +51,9 @@ module Spectator
|
|||
# and only after all examples in the group have finished.
|
||||
# Subsequent calls after the hooks have been run will do nothing.
|
||||
# Parent "after-all" hooks will be run last.
|
||||
protected def run_after_all_hooks : Nil
|
||||
protected def run_after_all_hooks(ignore_unfinished = false) : Nil
|
||||
super
|
||||
parent.run_after_all_hooks
|
||||
parent.run_after_all_hooks(ignore_unfinished)
|
||||
end
|
||||
|
||||
# Runs all of the "after-each" hooks.
|
||||
|
|
|
@ -34,7 +34,10 @@ module Spectator
|
|||
example_order.each do |example|
|
||||
result = run_example(example).as(Result)
|
||||
results << result
|
||||
break if @config.fail_fast? && result.is_a?(FailedResult)
|
||||
if @config.fail_fast? && result.is_a?(FailedResult)
|
||||
example.group.run_after_all_hooks(ignore_unfinished: true)
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue