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
|
end
|
||||||
|
|
||||||
def run
|
def run
|
||||||
|
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 %})
|
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
|
end
|
||||||
|
|
||||||
def description
|
def description
|
||||||
|
|
|
@ -24,8 +24,6 @@ module Spectator
|
||||||
|
|
||||||
private def run_example(example)
|
private def run_example(example)
|
||||||
error = nil
|
error = nil
|
||||||
example.context.run_before_all_hooks
|
|
||||||
example.context.run_before_each_hooks
|
|
||||||
elapsed = Time.measure do
|
elapsed = Time.measure do
|
||||||
begin
|
begin
|
||||||
example.run
|
example.run
|
||||||
|
@ -33,8 +31,6 @@ module Spectator
|
||||||
error = ex
|
error = ex
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
example.context.run_after_each_hooks
|
|
||||||
example.context.run_after_all_hooks
|
|
||||||
case error
|
case error
|
||||||
when Nil
|
when Nil
|
||||||
SuccessfulExampleResult.new(example, elapsed)
|
SuccessfulExampleResult.new(example, elapsed)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue