Skip to content

Commit 8e91b96

Browse files
committed
Workaround with fbb4e3f
1 parent da5b283 commit 8e91b96

6 files changed

+18
-18
lines changed

test/rubygems/test_gem_commands_signin_command.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ def test_execute_when_already_signed_in_with_same_host
3030
host = 'http://some-gemcutter-compatible-host.org'
3131

3232
util_capture(nil, host) { @cmd.execute }
33-
old_credentials = YAML.load_file Gem.configuration.credentials_path
33+
old_credentials = YAML.unsafe_load_file Gem.configuration.credentials_path
3434

3535
util_capture(nil, host) { @cmd.execute }
36-
new_credentials = YAML.load_file Gem.configuration.credentials_path
36+
new_credentials = YAML.unsafe_load_file Gem.configuration.credentials_path
3737

3838
assert_equal old_credentials[host], new_credentials[host]
3939
end
@@ -45,7 +45,7 @@ def test_execute_when_already_signed_in_with_different_host
4545
host = 'http://some-gemcutter-compatible-host.org'
4646

4747
util_capture(nil, host, api_key) { @cmd.execute }
48-
credentials = YAML.load_file Gem.configuration.credentials_path
48+
credentials = YAML.unsafe_load_file Gem.configuration.credentials_path
4949

5050
assert_equal credentials[:rubygems_api_key], api_key
5151

@@ -60,15 +60,15 @@ def test_execute_with_host_supplied
6060
assert_match %r{Signed in.}, sign_in_ui.output
6161

6262
api_key = 'a5fdbb6ba150cbb83aad2bb2fede64cf040453903'
63-
credentials = YAML.load_file Gem.configuration.credentials_path
63+
credentials = YAML.unsafe_load_file Gem.configuration.credentials_path
6464
assert_equal api_key, credentials[host]
6565
end
6666

6767
def test_execute_with_valid_creds_set_for_default_host
6868
util_capture { @cmd.execute }
6969

7070
api_key = 'a5fdbb6ba150cbb83aad2bb2fede64cf040453903'
71-
credentials = YAML.load_file Gem.configuration.credentials_path
71+
credentials = YAML.unsafe_load_file Gem.configuration.credentials_path
7272

7373
assert_equal api_key, credentials[:rubygems_api_key]
7474
end
@@ -94,7 +94,7 @@ def test_excute_with_key_name_and_scope
9494
assert_match "show_dashboard [y/N]", key_name_ui.output
9595
assert_equal "name=test-key&push_rubygem=true", fetcher.last_request.body
9696

97-
credentials = YAML.load_file Gem.configuration.credentials_path
97+
credentials = YAML.unsafe_load_file Gem.configuration.credentials_path
9898
assert_equal api_key, credentials[:rubygems_api_key]
9999
end
100100

test/rubygems/test_gem_commands_specification_command.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def test_execute_field
114114
@cmd.execute
115115
end
116116

117-
assert_equal "foo", YAML.load(@ui.output)
117+
assert_equal "foo", YAML.unsafe_load(@ui.output)
118118
end
119119

120120
def test_execute_file
@@ -230,7 +230,7 @@ def test_execute_remote_without_prerelease
230230
assert_match %r{\A--- !ruby/object:Gem::Specification}, @ui.output
231231
assert_match %r{name: foo}, @ui.output
232232

233-
spec = YAML.load @ui.output
233+
spec = YAML.unsafe_load @ui.output
234234

235235
assert_equal Gem::Version.new("2.0.0"), spec.version
236236
end
@@ -252,7 +252,7 @@ def test_execute_remote_with_prerelease
252252
assert_match %r{\A--- !ruby/object:Gem::Specification}, @ui.output
253253
assert_match %r{name: foo}, @ui.output
254254

255-
spec = YAML.load @ui.output
255+
spec = YAML.unsafe_load @ui.output
256256

257257
assert_equal Gem::Version.new("2.0.1.pre"), spec.version
258258
end

test/rubygems/test_gem_config_file.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ def test_rubygems_api_key_equals
354354
:rubygems_api_key => 'x',
355355
}
356356

357-
assert_equal expected, YAML.load_file(@cfg.credentials_path)
357+
assert_equal expected, YAML.unsafe_load_file(@cfg.credentials_path)
358358

359359
unless win_platform?
360360
stat = File.stat @cfg.credentials_path
@@ -378,7 +378,7 @@ def test_rubygems_api_key_equals_bad_permission
378378
:rubygems_api_key => 'x',
379379
}
380380

381-
assert_equal expected, YAML.load_file(@cfg.credentials_path)
381+
assert_equal expected, YAML.unsafe_load_file(@cfg.credentials_path)
382382

383383
stat = File.stat @cfg.credentials_path
384384

test/rubygems/test_gem_gemcutter_utilities.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def test_sign_in
101101
assert @fetcher.last_request["authorization"]
102102
assert_match %r{Signed in.}, @sign_in_ui.output
103103

104-
credentials = YAML.load_file Gem.configuration.credentials_path
104+
credentials = YAML.unsafe_load_file Gem.configuration.credentials_path
105105
assert_equal api_key, credentials[:rubygems_api_key]
106106
end
107107

@@ -115,7 +115,7 @@ def test_sign_in_with_host
115115
assert @fetcher.last_request["authorization"]
116116
assert_match %r{Signed in.}, @sign_in_ui.output
117117

118-
credentials = YAML.load_file Gem.configuration.credentials_path
118+
credentials = YAML.unsafe_load_file Gem.configuration.credentials_path
119119
assert_equal api_key, credentials['http://example.com']
120120
end
121121

@@ -129,7 +129,7 @@ def test_sign_in_with_host_nil
129129
assert @fetcher.last_request["authorization"]
130130
assert_match %r{Signed in.}, @sign_in_ui.output
131131

132-
credentials = YAML.load_file Gem.configuration.credentials_path
132+
credentials = YAML.unsafe_load_file Gem.configuration.credentials_path
133133
assert_equal api_key, credentials[:rubygems_api_key]
134134
end
135135

@@ -142,7 +142,7 @@ def test_sign_in_with_host_ENV
142142
assert @fetcher.last_request["authorization"]
143143
assert_match %r{Signed in.}, @sign_in_ui.output
144144

145-
credentials = YAML.load_file Gem.configuration.credentials_path
145+
credentials = YAML.unsafe_load_file Gem.configuration.credentials_path
146146
assert_equal api_key, credentials['http://example.com']
147147
end
148148

@@ -177,7 +177,7 @@ def test_sign_in_with_other_credentials_doesnt_overwrite_other_keys
177177
assert_match %r{Enter your RubyGems.org credentials.}, @sign_in_ui.output
178178
assert_match %r{Signed in.}, @sign_in_ui.output
179179

180-
credentials = YAML.load_file Gem.configuration.credentials_path
180+
credentials = YAML.unsafe_load_file Gem.configuration.credentials_path
181181
assert_equal api_key, credentials[:rubygems_api_key]
182182
assert_equal other_api_key, credentials[:other_api_key]
183183
end

test/rubygems/test_gem_package.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def test_add_checksums
9898
},
9999
}
100100

101-
assert_equal expected, YAML.load(checksums)
101+
assert_equal expected, YAML.unsafe_load(checksums)
102102
end
103103

104104
def test_build_time_uses_source_date_epoch

test/rubygems/test_gem_specification.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2649,7 +2649,7 @@ def test_to_yaml_platform_legacy
26492649

26502650
yaml_str = @a1.to_yaml
26512651

2652-
same_spec = YAML.load yaml_str
2652+
same_spec = YAML.unsafe_load yaml_str
26532653

26542654
assert_equal Gem::Platform.new('powerpc-darwin7'), same_spec.platform
26552655
assert_equal 'powerpc-darwin7.9.0', same_spec.original_platform

0 commit comments

Comments
 (0)