[前][次][番号順一覧][スレッド一覧]

ruby-changes:56923

From: Hiroshi <ko1@a...>
Date: Sun, 11 Aug 2019 06:14:21 +0900 (JST)
Subject: [ruby-changes:56923] Hiroshi SHIBATA: 2990c2cc3e (master): Use capture_output instead of capture_io.

https://git.ruby-lang.org/ruby.git/commit/?id=2990c2cc3e

From 2990c2cc3e5a105013b829dad00fa43a26da8682 Mon Sep 17 00:00:00 2001
From: Hiroshi SHIBATA <hsbt@r...>
Date: Sun, 11 Aug 2019 06:12:46 +0900
Subject: Use capture_output instead of capture_io.

  It's preparation for migrating test-unit on upstream.

diff --git a/test/rdoc/minitest_helper.rb b/test/rdoc/minitest_helper.rb
index 5db0c31..50e41eb 100644
--- a/test/rdoc/minitest_helper.rb
+++ b/test/rdoc/minitest_helper.rb
@@ -189,10 +189,10 @@ class RDoc::TestCase < (defined?(Minitest::Test) ? Minitest::Test : MiniTest::Un https://github.com/ruby/ruby/blob/trunk/test/rdoc/minitest_helper.rb#L189
   end
 
   ##
-  # run capture_io with setting $VERBOSE = true
+  # run capture_output with setting $VERBOSE = true
 
-  def verbose_capture_io
-    capture_io do
+  def verbose_capture_output
+    capture_output do
       begin
         orig_verbose = $VERBOSE
         $VERBOSE = true
diff --git a/test/rdoc/test_rdoc_context.rb b/test/rdoc/test_rdoc_context.rb
index be17496..ecdb3cb 100644
--- a/test/rdoc/test_rdoc_context.rb
+++ b/test/rdoc/test_rdoc_context.rb
@@ -232,7 +232,7 @@ class TestRDocContext < XrefTestCase https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_context.rb#L232
     meth2.record_location @store.add_file 'second.rb'
     meth2.comment = comment 'second'
 
-    _, err = verbose_capture_io do
+    _, err = verbose_capture_output do
       @context.add_method meth2
     end
 
@@ -260,7 +260,7 @@ class TestRDocContext < XrefTestCase https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_context.rb#L260
     meth2.record_location @store.add_file 'second.rb'
     meth2.comment = comment 'second'
 
-    _, err = verbose_capture_io do
+    _, err = verbose_capture_output do
       @context.add_method meth2
     end
 
diff --git a/test/rdoc/test_rdoc_context_section.rb b/test/rdoc/test_rdoc_context_section.rb
index 93cfbdf..ede6760 100644
--- a/test/rdoc/test_rdoc_context_section.rb
+++ b/test/rdoc/test_rdoc_context_section.rb
@@ -144,7 +144,7 @@ class TestRDocContextSection < RDoc::TestCase https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_context_section.rb#L144
   end
 
   def test_sequence
-    _, err = verbose_capture_io do
+    _, err = verbose_capture_output do
       assert_match(/\ASEC\d{5}\Z/, @s.sequence)
     end
 
diff --git a/test/rdoc/test_rdoc_encoding.rb b/test/rdoc/test_rdoc_encoding.rb
index 5b2de47..02b31cf 100644
--- a/test/rdoc/test_rdoc_encoding.rb
+++ b/test/rdoc/test_rdoc_encoding.rb
@@ -54,7 +54,7 @@ class TestRDocEncoding < RDoc::TestCase https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_encoding.rb#L54
 
     contents = :junk
 
-    _, err = verbose_capture_io do
+    _, err = verbose_capture_output do
       contents = RDoc::Encoding.read_file @tempfile.path, Encoding::US_ASCII
     end
 
@@ -97,7 +97,7 @@ class TestRDocEncoding < RDoc::TestCase https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_encoding.rb#L97
     @tempfile.flush
 
     contents = :junk
-    _, err = verbose_capture_io do
+    _, err = verbose_capture_output do
       contents = RDoc::Encoding.read_file @tempfile.path, Encoding::UTF_8
     end
 
diff --git a/test/rdoc/test_rdoc_markup_pre_process.rb b/test/rdoc/test_rdoc_markup_pre_process.rb
index 60ec75c..000268a 100644
--- a/test/rdoc/test_rdoc_markup_pre_process.rb
+++ b/test/rdoc/test_rdoc_markup_pre_process.rb
@@ -73,7 +73,7 @@ contents of a string. https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_markup_pre_process.rb#L73
 
   def test_include_file_in_other_directory
     content = nil
-    out, err = capture_io do
+    out, err = capture_output do
       content = @pp.include_file "test.txt", '', nil
     end
 
diff --git a/test/rdoc/test_rdoc_options.rb b/test/rdoc/test_rdoc_options.rb
index b6769d1..9f41713 100644
--- a/test/rdoc/test_rdoc_options.rb
+++ b/test/rdoc/test_rdoc_options.rb
@@ -20,7 +20,7 @@ class TestRDocOptions < RDoc::TestCase https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_options.rb#L20
     skip "assumes UNIX permission model" if /mswin|mingw/ =~ RUBY_PLATFORM
     skip "assumes that euid is not root" if Process.euid == 0
 
-    out, err = capture_io do
+    out, err = capture_output do
       temp_dir do
         FileUtils.touch 'unreadable'
         FileUtils.chmod 0, 'unreadable'
@@ -40,7 +40,7 @@ class TestRDocOptions < RDoc::TestCase https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_options.rb#L40
   def test_check_files_warn
     @options.verbosity = 2
 
-    out, err = verbose_capture_io do
+    out, err = verbose_capture_output do
       @options.files = %w[nonexistent]
 
       @options.check_files
@@ -218,7 +218,7 @@ rdoc_include: https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_options.rb#L218
   end
 
   def test_parse_dash_p
-    out, err = capture_io do
+    out, err = capture_output do
       @options.parse %w[-p]
     end
 
@@ -230,7 +230,7 @@ rdoc_include: https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_options.rb#L230
   end
 
   def test_parse_dash_p_files
-    out, err = capture_io do
+    out, err = capture_output do
       @options.parse ['-p', File.expand_path(__FILE__)]
     end
 
@@ -253,7 +253,7 @@ rdoc_include: https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_options.rb#L253
     dep_hash = RDoc::Options::DEPRECATED
     options = dep_hash.keys.sort
 
-    out, err = capture_io do
+    out, err = capture_output do
       @options.parse options
     end
 
@@ -278,7 +278,7 @@ rdoc_include: https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_options.rb#L278
   end
 
   def test_parse_encoding_invalid
-    out, err = capture_io do
+    out, err = capture_output do
       @options.parse %w[--encoding invalid]
     end
 
@@ -333,7 +333,7 @@ rdoc_include: https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_options.rb#L333
   end
 
   def test_parse_h
-    out, = capture_io do
+    out, = capture_output do
       begin
         @options.parse %w[-h]
       rescue SystemExit
@@ -345,7 +345,7 @@ rdoc_include: https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_options.rb#L345
   end
 
   def test_parse_help
-    out, = capture_io do
+    out, = capture_output do
       begin
         @options.parse %w[--help]
       rescue SystemExit
@@ -365,7 +365,7 @@ rdoc_include: https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_options.rb#L365
       end
     end
 
-    out, = capture_io do
+    out, = capture_output do
       begin
         @options.parse %w[--help]
       rescue SystemExit
@@ -392,7 +392,7 @@ rdoc_include: https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_options.rb#L392
   end
 
   def test_parse_ignore_invalid
-    out, err = capture_io do
+    out, err = capture_output do
       @options.parse %w[--ignore-invalid --bogus]
     end
 
@@ -403,7 +403,7 @@ rdoc_include: https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_options.rb#L403
   end
 
   def test_parse_ignore_invalid_default
-    out, err = capture_io do
+    out, err = capture_output do
       @options.parse %w[--bogus --main BLAH]
     end
 
@@ -416,7 +416,7 @@ rdoc_include: https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_options.rb#L416
   end
 
   def test_parse_ignore_invalid_no
-    out, err = capture_io do
+    out, err = capture_output do
       assert_raises SystemExit do
         @options.parse %w[--no-ignore-invalid --bogus=arg --bobogus --visibility=extended]
       end
@@ -429,7 +429,7 @@ rdoc_include: https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_options.rb#L429
   end
 
   def test_parse_ignore_invalid_no_quiet
-    out, err = capture_io do
+    out, err = capture_output do
       assert_raises SystemExit do
         @options.parse %w[--quiet --no-ignore-invalid --bogus=arg --bobogus --visibility=extended]
       end
@@ -442,7 +442,7 @@ rdoc_include: https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_options.rb#L442
   end
 
   def test_ignore_needless_arg
-    out, err = capture_io do
+    out, err = capture_output do
       @options.parse %w[--ri=foo]
     end
 
@@ -452,7 +452,7 @@ rdoc_include: https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_options.rb#L452
   end
 
   def test_ignore_missing_arg
-    out, err = capture_io do
+    out, err = capture_output do
       @options.parse %w[--copy-files]
     end
 
@@ -462,7 +462,7 @@ rdoc_include: https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_options.rb#L462
   end
 
   def test_parse_main
-    out, err = capture_io do
+    out, err = capture_output do
       @options.parse %w[--main MAIN]
     end
 
@@ -473,7 +473,7 @@ rdoc_include: https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_options.rb#L473
   end
 
   def test_parse_markup
-    out, err = capture_io do
+    out, err = capture_output do
       @options.parse %w[--markup tomdoc]
     end
 
@@ -486,7 +486,7 @@ rdoc_include: https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_options.rb#L486
   def test_parse_page_dir
     assert_nil @options.page_dir
 
-    out, err = capture_io do
+    out, err = capture_output do
       @options.parse %W[--page-dir #{Dir.tmpdir}]
     end
 
@@ -508,7 +508,7 @@ rdoc_include: https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_options.rb#L508
       abs_page_dir = File.join dir, 'pages'
       FileUtils.mkdir abs_page_dir
 
-      out, err = capture_io do
+      out, err = capture_output do
         @options.parse %W[--page-dir #{abs_page_dir} --root #{abs_root}]
       end
 
@@ -530,7 +530,7 @@ rdoc_include: https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_options.rb#L530
   def test_parse_root
     assert_equal Pathname(Dir.pwd), @options.root
 
-    out, err = capture_io do
+    out, err = capture_output do
       @options.parse %W[--root #{Dir.tmpdir}]
     end
 
@@ -548,13 +548,13 @@ rdoc_include: https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_options.rb#L548
     @options.parse %w[-w2]
     assert_equal 2, @opti (... truncated)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]