mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Initial code to run hooks
This commit is contained in:
parent
2f4cbd9c33
commit
4533cffce7
1 changed files with 14 additions and 1 deletions
|
@ -49,7 +49,20 @@ module Spectator
|
|||
@@current = self
|
||||
Log.debug { "Running example #{self}" }
|
||||
Log.warn { "Example #{self} already ran" } if @finished
|
||||
@result = Harness.run { @entrypoint.call(self) }
|
||||
@result = Harness.run do
|
||||
if (parent = group?)
|
||||
parent.call_once_before_all
|
||||
parent.call_before_each(self)
|
||||
end
|
||||
|
||||
@entrypoint.call(self)
|
||||
@finished = true
|
||||
|
||||
if (parent = group?)
|
||||
parent.call_after_each(self)
|
||||
parent.call_once_after_all if parent.finished?
|
||||
end
|
||||
end
|
||||
ensure
|
||||
@@current = nil
|
||||
@finished = true
|
||||
|
|
Loading…
Reference in a new issue