Skip to content

Commit

Permalink
Only run after_all hooks once group completes
Browse files Browse the repository at this point in the history
  • Loading branch information
icy-arctic-fox committed Dec 24, 2024
1 parent 37afd21 commit 85d6a9a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/spectator/core/hooks.cr
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@ module Spectator::Core

@before_all_hooks.try &.each &.call
proc.run
@after_all_hooks.try &.each &.call

# Only run after_all hooks if this is the last example to run in its group.
@after_all_hooks.try &.each &.call if run?
end
end

Expand Down

0 comments on commit 85d6a9a

Please sign in to comment.