mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Move hook execution into Example#run
This commit is contained in:
parent
5b275f3146
commit
77753ab974
2 changed files with 8 additions and 5 deletions
|
@ -156,7 +156,14 @@ module Spectator
|
|||
end
|
||||
|
||||
def run
|
||||
Example%example.new.%run({% for v, i in var_names %}%var{i}{% if i < var_names.size - 1 %}, {% end %}{% end %})
|
||||
context.run_before_all_hooks
|
||||
context.run_before_each_hooks
|
||||
begin
|
||||
Example%example.new.%run({% for v, i in var_names %}%var{i}{% if i < var_names.size - 1 %}, {% end %}{% end %})
|
||||
ensure
|
||||
context.run_after_each_hooks
|
||||
context.run_after_all_hooks
|
||||
end
|
||||
end
|
||||
|
||||
def description
|
||||
|
|
|
@ -24,8 +24,6 @@ module Spectator
|
|||
|
||||
private def run_example(example)
|
||||
error = nil
|
||||
example.context.run_before_all_hooks
|
||||
example.context.run_before_each_hooks
|
||||
elapsed = Time.measure do
|
||||
begin
|
||||
example.run
|
||||
|
@ -33,8 +31,6 @@ module Spectator
|
|||
error = ex
|
||||
end
|
||||
end
|
||||
example.context.run_after_each_hooks
|
||||
example.context.run_after_all_hooks
|
||||
case error
|
||||
when Nil
|
||||
SuccessfulExampleResult.new(example, elapsed)
|
||||
|
|
Loading…
Reference in a new issue