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,
|
# The hooks will be run only once,
|
||||||
# and only after all examples in the group have finished.
|
# and only after all examples in the group have finished.
|
||||||
# Subsequent calls after the hooks have been run will do nothing.
|
# 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 if @after_all_hooks_run
|
||||||
return unless finished?
|
return unless ignore_unfinished || finished?
|
||||||
|
|
||||||
@hooks.run_after_all
|
@hooks.run_after_all
|
||||||
@after_all_hooks_run = true
|
@after_all_hooks_run = true
|
||||||
end
|
end
|
||||||
|
|
|
@ -51,9 +51,9 @@ module Spectator
|
||||||
# and only after all examples in the group have finished.
|
# and only after all examples in the group have finished.
|
||||||
# Subsequent calls after the hooks have been run will do nothing.
|
# Subsequent calls after the hooks have been run will do nothing.
|
||||||
# Parent "after-all" hooks will be run last.
|
# 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
|
super
|
||||||
parent.run_after_all_hooks
|
parent.run_after_all_hooks(ignore_unfinished)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Runs all of the "after-each" hooks.
|
# Runs all of the "after-each" hooks.
|
||||||
|
|
|
@ -34,7 +34,10 @@ module Spectator
|
||||||
example_order.each do |example|
|
example_order.each do |example|
|
||||||
result = run_example(example).as(Result)
|
result = run_example(example).as(Result)
|
||||||
results << 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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue