Skip to content

Commit

Permalink
Make TestHelpers#silent to also suppress stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
agis committed Oct 11, 2020
1 parent 1584014 commit a9c4490
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/test_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,14 @@ def silent
end

begin
orig = $stdout.clone
orig_out = $stdout.clone
orig_err = $stderr.clone
$stdout.reopen(File::NULL, "w")
$stderr.reopen(File::NULL, "w")
yield
ensure
$stdout.reopen(orig)
$stdout.reopen(orig_out)
$stderr.reopen(orig_err)
end
end
end
Expand Down

0 comments on commit a9c4490

Please sign in to comment.