From 26cbda8dc903d5d663f6c759be073df3346c6874 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA 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 dc282dd8fb..778a5017dd 100644 --- a/test/rubygems/test_deprecate.rb +++ b/test/rubygems/test_deprecate.rb @@ -96,7 +96,7 @@ class TestDeprecate < Gem::TestCase 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 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 8b028d3495..4f99bc8e58 100644 --- a/test/rubygems/test_gem.rb +++ b/test/rubygems/test_gem.rb @@ -1389,7 +1389,7 @@ class TestGem < Gem::TestCase 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 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 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 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 fe537780be..4b94e80761 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 @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 c922e40eab..da5b411c83 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 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 7db31013aa..27da7d8206 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. 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 1cef52234e..1f0f0f1b5c 100644 --- a/test/rubygems/test_gem_doctor.rb +++ b/test/rubygems/test_gem_doctor.rb @@ -38,7 +38,7 @@ class TestGemDoctor < Gem::TestCase 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 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 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 2a9663959c..3500a9d519 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 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 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 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 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 38a381570d..aeb7fa2ab9 100644 --- a/test/rubygems/test_gem_server.rb +++ b/test/rubygems/test_gem_server.rb @@ -133,7 +133,7 @@ class TestGemServer < Gem::TestCase def test_listen util_listen - capture_io do + capture_output do @server.listen end @@ -143,7 +143,7 @@ class TestGemServer < Gem::TestCase 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 3c4811aad5..7b6bbcb35a 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 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 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 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 @@ class TestGemSilentUI < Gem::TestCase assert_empty out, 'No output' assert_empty err, 'No output' - out, err = capture_io do + out, err = capture_output do use_ui @sui do value = @sui.ask_yes_no 'Problem?', true end @@ -66,7 +66,7 @@ class TestGemSilentUI < Gem::TestCase assert value, 'Value is true' - out, err = capture_io do + out, err = capture_output do use_ui @sui do value = @sui.ask_yes_no 'Problem?', false end @@ -80,7 +80,7 @@ class TestGemSilentUI < Gem::TestCase def test_choose_from_list value = nil - out, err = capture_io do + out, err = capture_output do use_ui @sui do value = @sui.choose_from_list 'Problem?', %w[yes no] end @@ -93,7 +93,7 @@ class TestGemSilentUI < Gem::TestCase end def test_progress_reporter - out, err = capture_io do + out, err = capture_output do use_ui @sui do @sui.progress_reporter 10, 'hi' end @@ -104,7 +104,7 @@ class TestGemSilentUI < Gem::TestCase end def test_download_reporter - out, err = capture_io do + out, err = capture_output do use_ui @sui do @sui.download_reporter.fetch 'a.gem', 1024 end diff --git a/test/rubygems/test_gem_source_git.rb b/test/rubygems/test_gem_source_git.rb index f5406d2215..2a082dec51 100644 --- a/test/rubygems/test_gem_source_git.rb +++ b/test/rubygems/test_gem_source_git.rb @@ -240,7 +240,7 @@ class TestGemSourceGit < Gem::TestCase specs = nil - capture_io do + capture_output do specs = source.specs end @@ -275,7 +275,7 @@ class TestGemSourceGit < Gem::TestCase source = Gem::Source::Git.new @name, @repository, 'master', true source.remote = false - capture_io do + capture_output do assert_empty source.specs end end diff --git a/test/rubygems/test_gem_specification.rb b/test/rubygems/test_gem_specification.rb index 1389b495f2..0f895e3cf3 100644 --- a/test/rubygems/test_gem_specification.rb +++ b/test/rubygems/test_gem_specification.rb @@ -1669,7 +1669,7 @@ dependencies: [] skip "extensions don't quite work on jruby" if Gem.java_platform? ext_spec - _, err = capture_io do + _, err = capture_output do refute @ext.contains_requirable_file? 'nonexistent' end @@ -1682,7 +1682,7 @@ dependencies: [] def test_contains_requirable_file_eh_extension_java_platform ext_spec(platform: Gem::Platform.new("java")) - _, err = capture_io do + _, err = capture_output do refute @ext.contains_requirable_file? 'nonexistent' end @@ -3515,7 +3515,7 @@ Did you mean 'Ruby'? specfile.write "raise 'boom'" specfile.close begin - capture_io do + capture_output do Gem::Specification.load(specfile.path) end rescue => e diff --git a/test/rubygems/test_gem_stub_specification.rb b/test/rubygems/test_gem_stub_specification.rb index 2ee94dcf8d..ff74fd19ca 100644 --- a/test/rubygems/test_gem_stub_specification.rb +++ b/test/rubygems/test_gem_stub_specification.rb @@ -67,7 +67,7 @@ class TestStubSpecification < Gem::TestCase def test_contains_requirable_file_eh_extension skip "I guess making the stub match the running platform should work" if Gem.java_platform? stub_with_extension do |stub| - _, err = capture_io do + _, err = capture_output do refute stub.contains_requirable_file? 'nonexistent' end @@ -189,7 +189,7 @@ class TestStubSpecification < Gem::TestCase def test_to_spec_missing_extensions stub = stub_with_extension - capture_io do + capture_output do stub.contains_requirable_file? 'nonexistent' end -- cgit v1.2.1