summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2021-05-17 11:59:59 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-05-17 12:00:05 +0900
commit8e91b969df08b7a2eb27a5d6d38733eea42dc7ad (patch)
tree2478d5e7f2e4c99e04cf4678ce998343c1d040b2
parentda5b28396397ace84d914cb188055cbeb46b8725 (diff)
Workaround with fbb4e3f96c10de2240f2d87eac19cf6f62f65fea
-rw-r--r--test/rubygems/test_gem_commands_signin_command.rb12
-rw-r--r--test/rubygems/test_gem_commands_specification_command.rb6
-rw-r--r--test/rubygems/test_gem_config_file.rb4
-rw-r--r--test/rubygems/test_gem_gemcutter_utilities.rb10
-rw-r--r--test/rubygems/test_gem_package.rb2
-rw-r--r--test/rubygems/test_gem_specification.rb2
6 files changed, 18 insertions, 18 deletions
diff --git a/test/rubygems/test_gem_commands_signin_command.rb b/test/rubygems/test_gem_commands_signin_command.rb
index f8262466b1..a36744e3c5 100644
--- a/test/rubygems/test_gem_commands_signin_command.rb
+++ b/test/rubygems/test_gem_commands_signin_command.rb
@@ -30,10 +30,10 @@ class TestGemCommandsSigninCommand < Gem::TestCase
host = 'http://some-gemcutter-compatible-host.org'
util_capture(nil, host) { @cmd.execute }
- old_credentials = YAML.load_file Gem.configuration.credentials_path
+ old_credentials = YAML.unsafe_load_file Gem.configuration.credentials_path
util_capture(nil, host) { @cmd.execute }
- new_credentials = YAML.load_file Gem.configuration.credentials_path
+ new_credentials = YAML.unsafe_load_file Gem.configuration.credentials_path
assert_equal old_credentials[host], new_credentials[host]
end
@@ -45,7 +45,7 @@ class TestGemCommandsSigninCommand < Gem::TestCase
host = 'http://some-gemcutter-compatible-host.org'
util_capture(nil, host, api_key) { @cmd.execute }
- credentials = YAML.load_file Gem.configuration.credentials_path
+ credentials = YAML.unsafe_load_file Gem.configuration.credentials_path
assert_equal credentials[:rubygems_api_key], api_key
@@ -60,7 +60,7 @@ class TestGemCommandsSigninCommand < Gem::TestCase
assert_match %r{Signed in.}, sign_in_ui.output
api_key = 'a5fdbb6ba150cbb83aad2bb2fede64cf040453903'
- credentials = YAML.load_file Gem.configuration.credentials_path
+ credentials = YAML.unsafe_load_file Gem.configuration.credentials_path
assert_equal api_key, credentials[host]
end
@@ -68,7 +68,7 @@ class TestGemCommandsSigninCommand < Gem::TestCase
util_capture { @cmd.execute }
api_key = 'a5fdbb6ba150cbb83aad2bb2fede64cf040453903'
- credentials = YAML.load_file Gem.configuration.credentials_path
+ credentials = YAML.unsafe_load_file Gem.configuration.credentials_path
assert_equal api_key, credentials[:rubygems_api_key]
end
@@ -94,7 +94,7 @@ class TestGemCommandsSigninCommand < Gem::TestCase
assert_match "show_dashboard [y/N]", key_name_ui.output
assert_equal "name=test-key&push_rubygem=true", fetcher.last_request.body
- credentials = YAML.load_file Gem.configuration.credentials_path
+ credentials = YAML.unsafe_load_file Gem.configuration.credentials_path
assert_equal api_key, credentials[:rubygems_api_key]
end
diff --git a/test/rubygems/test_gem_commands_specification_command.rb b/test/rubygems/test_gem_commands_specification_command.rb
index 74a85e96ef..4dac3eb134 100644
--- a/test/rubygems/test_gem_commands_specification_command.rb
+++ b/test/rubygems/test_gem_commands_specification_command.rb
@@ -114,7 +114,7 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
@cmd.execute
end
- assert_equal "foo", YAML.load(@ui.output)
+ assert_equal "foo", YAML.unsafe_load(@ui.output)
end
def test_execute_file
@@ -230,7 +230,7 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
assert_match %r{\A--- !ruby/object:Gem::Specification}, @ui.output
assert_match %r{name: foo}, @ui.output
- spec = YAML.load @ui.output
+ spec = YAML.unsafe_load @ui.output
assert_equal Gem::Version.new("2.0.0"), spec.version
end
@@ -252,7 +252,7 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
assert_match %r{\A--- !ruby/object:Gem::Specification}, @ui.output
assert_match %r{name: foo}, @ui.output
- spec = YAML.load @ui.output
+ spec = YAML.unsafe_load @ui.output
assert_equal Gem::Version.new("2.0.1.pre"), spec.version
end
diff --git a/test/rubygems/test_gem_config_file.rb b/test/rubygems/test_gem_config_file.rb
index 92375c57b0..e155810384 100644
--- a/test/rubygems/test_gem_config_file.rb
+++ b/test/rubygems/test_gem_config_file.rb
@@ -354,7 +354,7 @@ if you believe they were disclosed to a third party.
:rubygems_api_key => 'x',
}
- assert_equal expected, YAML.load_file(@cfg.credentials_path)
+ assert_equal expected, YAML.unsafe_load_file(@cfg.credentials_path)
unless win_platform?
stat = File.stat @cfg.credentials_path
@@ -378,7 +378,7 @@ if you believe they were disclosed to a third party.
:rubygems_api_key => 'x',
}
- assert_equal expected, YAML.load_file(@cfg.credentials_path)
+ assert_equal expected, YAML.unsafe_load_file(@cfg.credentials_path)
stat = File.stat @cfg.credentials_path
diff --git a/test/rubygems/test_gem_gemcutter_utilities.rb b/test/rubygems/test_gem_gemcutter_utilities.rb
index c673c6271f..5f55f7ec5a 100644
--- a/test/rubygems/test_gem_gemcutter_utilities.rb
+++ b/test/rubygems/test_gem_gemcutter_utilities.rb
@@ -101,7 +101,7 @@ class TestGemGemcutterUtilities < Gem::TestCase
assert @fetcher.last_request["authorization"]
assert_match %r{Signed in.}, @sign_in_ui.output
- credentials = YAML.load_file Gem.configuration.credentials_path
+ credentials = YAML.unsafe_load_file Gem.configuration.credentials_path
assert_equal api_key, credentials[:rubygems_api_key]
end
@@ -115,7 +115,7 @@ class TestGemGemcutterUtilities < Gem::TestCase
assert @fetcher.last_request["authorization"]
assert_match %r{Signed in.}, @sign_in_ui.output
- credentials = YAML.load_file Gem.configuration.credentials_path
+ credentials = YAML.unsafe_load_file Gem.configuration.credentials_path
assert_equal api_key, credentials['http://example.com']
end
@@ -129,7 +129,7 @@ class TestGemGemcutterUtilities < Gem::TestCase
assert @fetcher.last_request["authorization"]
assert_match %r{Signed in.}, @sign_in_ui.output
- credentials = YAML.load_file Gem.configuration.credentials_path
+ credentials = YAML.unsafe_load_file Gem.configuration.credentials_path
assert_equal api_key, credentials[:rubygems_api_key]
end
@@ -142,7 +142,7 @@ class TestGemGemcutterUtilities < Gem::TestCase
assert @fetcher.last_request["authorization"]
assert_match %r{Signed in.}, @sign_in_ui.output
- credentials = YAML.load_file Gem.configuration.credentials_path
+ credentials = YAML.unsafe_load_file Gem.configuration.credentials_path
assert_equal api_key, credentials['http://example.com']
end
@@ -177,7 +177,7 @@ class TestGemGemcutterUtilities < Gem::TestCase
assert_match %r{Enter your RubyGems.org credentials.}, @sign_in_ui.output
assert_match %r{Signed in.}, @sign_in_ui.output
- credentials = YAML.load_file Gem.configuration.credentials_path
+ credentials = YAML.unsafe_load_file Gem.configuration.credentials_path
assert_equal api_key, credentials[:rubygems_api_key]
assert_equal other_api_key, credentials[:other_api_key]
end
diff --git a/test/rubygems/test_gem_package.rb b/test/rubygems/test_gem_package.rb
index 8f2f50c578..f5f071ba39 100644
--- a/test/rubygems/test_gem_package.rb
+++ b/test/rubygems/test_gem_package.rb
@@ -98,7 +98,7 @@ class TestGemPackage < Gem::Package::TarTestCase
},
}
- assert_equal expected, YAML.load(checksums)
+ assert_equal expected, YAML.unsafe_load(checksums)
end
def test_build_time_uses_source_date_epoch
diff --git a/test/rubygems/test_gem_specification.rb b/test/rubygems/test_gem_specification.rb
index d014eaea36..6e6d92a7de 100644
--- a/test/rubygems/test_gem_specification.rb
+++ b/test/rubygems/test_gem_specification.rb
@@ -2649,7 +2649,7 @@ end
yaml_str = @a1.to_yaml
- same_spec = YAML.load yaml_str
+ same_spec = YAML.unsafe_load yaml_str
assert_equal Gem::Platform.new('powerpc-darwin7'), same_spec.platform
assert_equal 'powerpc-darwin7.9.0', same_spec.original_platform