From 664e96b1de816c813c29f61e16a2031a7af7ba86 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sat, 26 Oct 2019 20:53:01 +0200 Subject: Update to ruby/spec@28a728b --- spec/ruby/core/io/shared/new.rb | 48 ++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'spec/ruby/core/io/shared') diff --git a/spec/ruby/core/io/shared/new.rb b/spec/ruby/core/io/shared/new.rb index cc76955784..a7b4fc1cbe 100644 --- a/spec/ruby/core/io/shared/new.rb +++ b/spec/ruby/core/io/shared/new.rb @@ -24,34 +24,34 @@ describe :io_new, shared: true do end it "creates an IO instance when STDOUT is closed" do - verbose, $VERBOSE = $VERBOSE, nil - stdout = STDOUT - stdout_file = tmp("stdout.txt") - - begin - @io = IO.send(@method, @fd, "w") - @io.should be_an_instance_of(IO) - ensure - STDOUT = stdout - $VERBOSE = verbose - rm_r stdout_file + suppress_warning do + stdout = STDOUT + stdout_file = tmp("stdout.txt") + + begin + @io = IO.send(@method, @fd, "w") + @io.should be_an_instance_of(IO) + ensure + STDOUT = stdout + rm_r stdout_file + end end end it "creates an IO instance when STDERR is closed" do - verbose, $VERBOSE = $VERBOSE, nil - stderr = STDERR - stderr_file = tmp("stderr.txt") - STDERR = new_io stderr_file - STDERR.close - - begin - @io = IO.send(@method, @fd, "w") - @io.should be_an_instance_of(IO) - ensure - STDERR = stderr - $VERBOSE = verbose - rm_r stderr_file + suppress_warning do + stderr = STDERR + stderr_file = tmp("stderr.txt") + STDERR = new_io stderr_file + STDERR.close + + begin + @io = IO.send(@method, @fd, "w") + @io.should be_an_instance_of(IO) + ensure + STDERR = stderr + rm_r stderr_file + end end end -- cgit v1.2.3