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
|
||||
@result = Harness.run do
|
||||
group?.try(&.call_once_before_all)
|
||||
if (parent = group?)
|
||||
parent.call_around_each(self) { run_internal }
|
||||
else
|
||||
run_internal
|
||||
end
|
||||
if (parent = group?)
|
||||
parent.call_once_after_all if parent.finished?
|
||||
end
|
||||
end
|
||||
ensure
|
||||
@@current = previous_example
|
||||
|
@ -67,9 +71,9 @@ module Spectator
|
|||
end
|
||||
|
||||
private def run_internal
|
||||
run_before_hooks
|
||||
group?.try(&.call_before_each(self))
|
||||
run_test
|
||||
run_after_hooks
|
||||
group?.try(&.call_after_each(self))
|
||||
end
|
||||
|
||||
private def run_before_hooks : Nil
|
||||
|
|
Loading…
Reference in a new issue