diff options
author | Benoit Daloze <eregontp@gmail.com> | 2019-10-26 20:53:01 +0200 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2019-10-26 20:53:01 +0200 |
commit | 664e96b1de816c813c29f61e16a2031a7af7ba86 (patch) | |
tree | 7f4691847cd6b3282812eea7e2be3758e08d1433 /spec/ruby/core/io/shared | |
parent | 3eb0d50c0baae916f4486c264605b18e77bee0dc (diff) |
Update to ruby/spec@28a728b
Diffstat (limited to 'spec/ruby/core/io/shared')
-rw-r--r-- | spec/ruby/core/io/shared/new.rb | 48 |
1 files changed, 24 insertions, 24 deletions
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 |