Run deferred expectations after all hooks

This commit is contained in:
Michael Miller 2020-01-20 20:15:49 -07:00
parent 1e3d89884b
commit 721425c3c8
2 changed files with 2 additions and 2 deletions

View file

@ -104,8 +104,7 @@ Spectator.describe "`before` and `after` hooks" do
@@order << :after_all
end
xit "gets run in order" do
# TODO: The after_all hook isn't evaluated yet because the group hasn't "finished."
it "gets run in order" do
expect(@@order).to_eventually eq(%i[before_all before_each after_each after_all])
end
end

View file

@ -19,6 +19,7 @@ module Spectator
ResultCapture.new.tap do |result|
context.run_before_hooks(self)
run_example(result)
@finished = true
context.run_after_hooks(self)
run_deferred(result) unless result.error
end