Skip to content

Commit

Permalink
do after teardown in around (not before around in after hook)
Browse files Browse the repository at this point in the history
  • Loading branch information
timdiggins committed May 4, 2022
1 parent 1f0fb32 commit 29a60c9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/rspec/rails/example/system_example_group.rb
Expand Up @@ -109,14 +109,18 @@ def driven_by(driver, **driver_options, &blk)
$stdout = StringIO.new
begin
original_before_teardown.bind(self).call
original_after_teardown.bind(self).call
ensure
myio = $stdout
myio.rewind
RSpec.current_example.metadata[:extra_failure_lines] = myio.readlines
$stdout = orig_stdout
end
end

around do |example|
example.run
original_after_teardown.bind(self).call
end
end
end
end
Expand Down

0 comments on commit 29a60c9

Please sign in to comment.