ruby-changes:66162
From: Hiroshi <ko1@a...>
Date: Wed, 12 May 2021 17:25:07 +0900 (JST)
Subject: [ruby-changes:66162] 26cbda8dc9 (master): [rubygems/rubygems] Use capture_output instead of capture_io.
https://git.ruby-lang.org/ruby.git/commit/?id=26cbda8dc9 From 26cbda8dc903d5d663f6c759be073df3346c6874 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA <hsbt@r...> Date: Sat, 29 Jun 2019 20:16:49 +0900 Subject: [rubygems/rubygems] Use capture_output instead of capture_io. https://github.com/rubygems/rubygems/commit/ad9206d4d0 --- test/rubygems/test_deprecate.rb | 4 ++-- test/rubygems/test_gem.rb | 8 ++++---- test/rubygems/test_gem_commands_build_command.rb | 2 +- test/rubygems/test_gem_commands_check_command.rb | 2 +- test/rubygems/test_gem_config_file.rb | 2 +- test/rubygems/test_gem_doctor.rb | 6 +++--- test/rubygems/test_gem_request_set_gem_dependency_api.rb | 8 ++++---- test/rubygems/test_gem_server.rb | 4 ++-- test/rubygems/test_gem_silent_ui.rb | 16 ++++++++-------- test/rubygems/test_gem_source_git.rb | 4 ++-- test/rubygems/test_gem_specification.rb | 6 +++--- test/rubygems/test_gem_stub_specification.rb | 4 ++-- 12 files changed, 33 insertions(+), 33 deletions(-) diff --git a/test/rubygems/test_deprecate.rb b/test/rubygems/test_deprecate.rb index dc282dd..778a501 100644 --- a/test/rubygems/test_deprecate.rb +++ b/test/rubygems/test_deprecate.rb @@ -96,7 +96,7 @@ class TestDeprecate < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_deprecate.rb#L96 end def test_deprecated_method_calls_the_old_method - capture_io do + capture_output do thing = Thing.new thing.foo assert_equal "foo", thing.message @@ -108,7 +108,7 @@ class TestDeprecate < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_deprecate.rb#L108 end def test_deprecated_method_outputs_a_warning - out, err = capture_io do + out, err = capture_output do thing = Thing.new thing.foo thing.foo_arg("msg") diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb index 8b028d3..4f99bc8 100644 --- a/test/rubygems/test_gem.rb +++ b/test/rubygems/test_gem.rb @@ -1389,7 +1389,7 @@ class TestGem < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem.rb#L1389 io.write spec.to_ruby_for_cache end - _, err = capture_io do + _, err = capture_output do refute Gem.try_activate 'nonexistent' end @@ -1414,7 +1414,7 @@ class TestGem < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem.rb#L1414 end def test_setting_paths_does_not_warn_about_unknown_keys - stdout, stderr = capture_io do + stdout, stderr = capture_output do Gem.paths = { 'foo' => [], 'bar' => Object.new, 'GEM_HOME' => Gem.paths.home, @@ -1432,7 +1432,7 @@ class TestGem < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem.rb#L1432 end def test_deprecated_paths= - stdout, stderr = capture_io do + stdout, stderr = capture_output do Gem.paths = { 'GEM_HOME' => Gem.paths.home, 'GEM_PATH' => [Gem.paths.home, 'foo'] } end @@ -2073,7 +2073,7 @@ You may need to `gem install -g` to install missing gems https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem.rb#L2073 refute_includes $LOAD_PATH, test_plugin_path $LOAD_PATH.unshift test_plugin_path - capture_io do + capture_output do yield end ensure diff --git a/test/rubygems/test_gem_commands_build_command.rb b/test/rubygems/test_gem_commands_build_command.rb index fe53778..4b94e80 100644 --- a/test/rubygems/test_gem_commands_build_command.rb +++ b/test/rubygems/test_gem_commands_build_command.rb @@ -208,7 +208,7 @@ class TestGemCommandsBuildCommand < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_build_command.rb#L208 @cmd.options[:args] = [gemspec_file] out, err = use_ui @ui do - capture_io do + capture_output do assert_raises Gem::MockGemUi::TermError do @cmd.execute end diff --git a/test/rubygems/test_gem_commands_check_command.rb b/test/rubygems/test_gem_commands_check_command.rb index c922e40..da5b411 100644 --- a/test/rubygems/test_gem_commands_check_command.rb +++ b/test/rubygems/test_gem_commands_check_command.rb @@ -55,7 +55,7 @@ class TestGemCommandsCheckCommand < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_check_command.rb#L55 Gem.use_paths @gemhome - capture_io do + capture_output do use_ui @ui do @cmd.doctor end diff --git a/test/rubygems/test_gem_config_file.rb b/test/rubygems/test_gem_config_file.rb index 7db3101..27da7d8 100644 --- a/test/rubygems/test_gem_config_file.rb +++ b/test/rubygems/test_gem_config_file.rb @@ -253,7 +253,7 @@ if you believe they were disclosed to a third party. https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_config_file.rb#L253 args = %w[--debug] - _, err = capture_io do + _, err = capture_output do @cfg.handle_arguments args end diff --git a/test/rubygems/test_gem_doctor.rb b/test/rubygems/test_gem_doctor.rb index 1cef522..1f0f0f1 100644 --- a/test/rubygems/test_gem_doctor.rb +++ b/test/rubygems/test_gem_doctor.rb @@ -38,7 +38,7 @@ class TestGemDoctor < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_doctor.rb#L38 doctor = Gem::Doctor.new @gemhome - capture_io do + capture_output do use_ui @ui do doctor.doctor end @@ -91,7 +91,7 @@ Removed directory gems/c-2 https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_doctor.rb#L91 doctor = Gem::Doctor.new @gemhome, true - capture_io do + capture_output do use_ui @ui do doctor.doctor end @@ -127,7 +127,7 @@ Extra directory gems/c-2 https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_doctor.rb#L127 doctor = Gem::Doctor.new @tempdir - capture_io do + capture_output do use_ui @ui do doctor.doctor end diff --git a/test/rubygems/test_gem_request_set_gem_dependency_api.rb b/test/rubygems/test_gem_request_set_gem_dependency_api.rb index 2a96639..3500a9d 100644 --- a/test/rubygems/test_gem_request_set_gem_dependency_api.rb +++ b/test/rubygems/test_gem_request_set_gem_dependency_api.rb @@ -81,7 +81,7 @@ class TestGemRequestSetGemDependencyAPI < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_request_set_gem_dependency_api.rb#L81 def test_gem_duplicate @gda.gem 'a' - _, err = capture_io do + _, err = capture_output do @gda.gem 'a' end @@ -129,7 +129,7 @@ class TestGemRequestSetGemDependencyAPI < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_request_set_gem_dependency_api.rb#L129 end def test_gem_git_branch - _, err = capture_io do + _, err = capture_output do @gda.gem 'a', :git => 'git/a', :branch => 'other', :tag => 'v1' end expected = "Gem dependencies file gem.deps.rb includes git reference for both ref/branch and tag but only ref/branch is used." @@ -150,7 +150,7 @@ class TestGemRequestSetGemDependencyAPI < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_request_set_gem_dependency_api.rb#L150 end def test_gem_git_ref - _, err = capture_io do + _, err = capture_output do @gda.gem 'a', :git => 'git/a', :ref => 'abcd123', :branch => 'other' end expected = "Gem dependencies file gem.deps.rb includes git reference for both ref and branch but only ref is used." @@ -518,7 +518,7 @@ class TestGemRequestSetGemDependencyAPI < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_request_set_gem_dependency_api.rb#L518 FileUtils.touch 'a.gemspec' e = assert_raises ArgumentError do - capture_io do + capture_output do @gda.gemspec end end diff --git a/test/rubygems/test_gem_server.rb b/test/rubygems/test_gem_server.rb index 38a3815..aeb7fa2 100644 --- a/test/rubygems/test_gem_server.rb +++ b/test/rubygems/test_gem_server.rb @@ -133,7 +133,7 @@ class TestGemServer < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_server.rb#L133 def test_listen util_listen - capture_io do + capture_output do @server.listen end @@ -143,7 +143,7 @@ class TestGemServer < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_server.rb#L143 def test_listen_addresses util_listen - capture_io do + capture_output do @server.listen %w[a b] end diff --git a/test/rubygems/test_gem_silent_ui.rb b/test/rubygems/test_gem_silent_ui.rb index 3c4811a..7b6bbcb 100644 --- a/test/rubygems/test_gem_silent_ui.rb +++ b/test/rubygems/test_gem_silent_ui.rb @@ -16,7 +16,7 @@ class TestGemSilentUI < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_silent_ui.rb#L16 def test_ask value = nil - out, err = capture_io do + out, err = capture_output do use_ui @sui do value = @sui.ask 'Problem?' end @@ -30,7 +30,7 @@ class TestGemSilentUI < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_silent_ui.rb#L30 def test_ask_for_password value = nil - out, err = capture_io do + out, err = capture_output do use_ui @sui do value = @sui.ask_for_password 'Problem?' end @@ -44,7 +44,7 @@ class TestGemSilentUI < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_silent_ui.rb#L44 def test_ask_yes_no value = nil - out, err = capture_io do + out, err = capture_output do use_ui @sui do assert_raises(Gem::OperationNotSupportedError) do @sui.ask_yes_no 'Problem?' @@ -55,7 +55,7 (... truncated) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/