mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Match hook ordering of RSpec
Addresses https://github.com/icy-arctic-fox/spectator/issues/12
This commit is contained in:
parent
cd519178ac
commit
57c9333c1f
1 changed files with 6 additions and 2 deletions
|
@ -54,11 +54,15 @@ module Spectator
|
||||||
|
|
||||||
begin
|
begin
|
||||||
@result = Harness.run do
|
@result = Harness.run do
|
||||||
|
group?.try(&.call_once_before_all)
|
||||||
if (parent = group?)
|
if (parent = group?)
|
||||||
parent.call_around_each(self) { run_internal }
|
parent.call_around_each(self) { run_internal }
|
||||||
else
|
else
|
||||||
run_internal
|
run_internal
|
||||||
end
|
end
|
||||||
|
if (parent = group?)
|
||||||
|
parent.call_once_after_all if parent.finished?
|
||||||
|
end
|
||||||
end
|
end
|
||||||
ensure
|
ensure
|
||||||
@@current = previous_example
|
@@current = previous_example
|
||||||
|
@ -67,9 +71,9 @@ module Spectator
|
||||||
end
|
end
|
||||||
|
|
||||||
private def run_internal
|
private def run_internal
|
||||||
run_before_hooks
|
group?.try(&.call_before_each(self))
|
||||||
run_test
|
run_test
|
||||||
run_after_hooks
|
group?.try(&.call_after_each(self))
|
||||||
end
|
end
|
||||||
|
|
||||||
private def run_before_hooks : Nil
|
private def run_before_hooks : Nil
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue