Skip to content

Commit 29a60c9

Browse files
committed
do after teardown in around (not before around in after hook)
1 parent 1f0fb32 commit 29a60c9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/rspec/rails/example/system_example_group.rb

+5-1
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,18 @@ def driven_by(driver, **driver_options, &blk)
109109
$stdout = StringIO.new
110110
begin
111111
original_before_teardown.bind(self).call
112-
original_after_teardown.bind(self).call
113112
ensure
114113
myio = $stdout
115114
myio.rewind
116115
RSpec.current_example.metadata[:extra_failure_lines] = myio.readlines
117116
$stdout = orig_stdout
118117
end
119118
end
119+
120+
around do |example|
121+
example.run
122+
original_after_teardown.bind(self).call
123+
end
120124
end
121125
end
122126
end

0 commit comments

Comments
 (0)