mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Reduce nesting of conditionals
This commit is contained in:
parent
101489ea19
commit
f3feabb6e0
1 changed files with 7 additions and 10 deletions
|
@ -127,11 +127,10 @@ module Spectator
|
|||
# The hooks will be run only once.
|
||||
# Subsequent calls to this method will do nothing.
|
||||
def run_before_all_hooks : Nil
|
||||
unless @before_all_hooks_run
|
||||
return if @before_all_hooks_run
|
||||
@hooks.run_before_all
|
||||
@before_all_hooks_run = true
|
||||
end
|
||||
end
|
||||
|
||||
# Runs all of the `before_each` hooks.
|
||||
# This method should run prior to every example in the group.
|
||||
|
@ -145,13 +144,11 @@ module Spectator
|
|||
# and only after all examples in the group have finished.
|
||||
# Subsequent calls after the hooks have been run will do nothing.
|
||||
def run_after_all_hooks : Nil
|
||||
unless @after_all_hooks_run
|
||||
if finished?
|
||||
return if @after_all_hooks_run
|
||||
return unless finished?
|
||||
@hooks.run_after_all
|
||||
@after_all_hooks_run = true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Runs all of the `after_each` hooks.
|
||||
# This method should run following every example in the group.
|
||||
|
|
Loading…
Reference in a new issue