summaryrefslogtreecommitdiff
path: root/tool/lib
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2021-09-11 21:05:15 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-09-11 21:05:15 +0900
commit8d0315a2bbda2cdefeaf00ff1edcd90384d8951a (patch)
treeb0fa33360d4742cfaf6c0c606b190485f0ca332d /tool/lib
parentd58e0ffc247a18bbd6ec5a7f78c79e171bda4168 (diff)
Removed unsed assertions for rubygems
Diffstat (limited to 'tool/lib')
-rw-r--r--tool/lib/test/unit/assertions.rb43
1 files changed, 0 insertions, 43 deletions
diff --git a/tool/lib/test/unit/assertions.rb b/tool/lib/test/unit/assertions.rb
index 1368312925..4ac1482b65 100644
--- a/tool/lib/test/unit/assertions.rb
+++ b/tool/lib/test/unit/assertions.rb
@@ -357,49 +357,6 @@ module Test
alias capture_output capture_io
##
- # Captures $stdout and $stderr into strings, using Tempfile to
- # ensure that subprocess IO is captured as well.
- #
- # out, err = capture_subprocess_io do
- # system "echo Some info"
- # system "echo You did a bad thing 1>&2"
- # end
- #
- # assert_match %r%info%, out
- # assert_match %r%bad%, err
- #
- # NOTE: This method is approximately 10x slower than #capture_io so
- # only use it when you need to test the output of a subprocess.
-
- def capture_subprocess_io
- require 'tempfile'
-
- captured_stdout, captured_stderr = Tempfile.new("out"), Tempfile.new("err")
-
- synchronize do
- orig_stdout, orig_stderr = $stdout.dup, $stderr.dup
- $stdout.reopen captured_stdout
- $stderr.reopen captured_stderr
-
- begin
- yield
-
- $stdout.rewind
- $stderr.rewind
-
- [captured_stdout.read, captured_stderr.read]
- ensure
- $stdout.reopen orig_stdout
- $stderr.reopen orig_stderr
- orig_stdout.close
- orig_stderr.close
- captured_stdout.close!
- captured_stderr.close!
- end
- end
- end
-
- ##
# Returns details for exception +e+
def exception_details e, msg