diff options
author | Hiroshi SHIBATA <[email protected]> | 2023-04-18 10:13:43 +0900 |
---|---|---|
committer | git <[email protected]> | 2023-04-19 06:56:22 +0000 |
commit | 92ab4e41dd6261d6f2fe04011508359544535164 (patch) | |
tree | 0f06f9605d4aee3606c6ea8aba042bcf5b22c3ff | |
parent | ef54a9aeb689164d99ccccc8cc92c588936fa321 (diff) |
[rubygems/rubygems] Replaced Gem::ConfigFile.dump_with_rubygems_yaml for saveing configuration
https://github.com/rubygems/rubygems/commit/46438e61cd
-rw-r--r-- | test/rubygems/test_gem_commands_push_command.rb | 11 | ||||
-rw-r--r-- | test/rubygems/test_gem_gemcutter_utilities.rb | 13 |
2 files changed, 14 insertions, 10 deletions
diff --git a/test/rubygems/test_gem_commands_push_command.rb b/test/rubygems/test_gem_commands_push_command.rb index aa0cf87474..baaf8e85c2 100644 --- a/test/rubygems/test_gem_commands_push_command.rb +++ b/test/rubygems/test_gem_commands_push_command.rb @@ -2,6 +2,7 @@ require_relative "helper" require "rubygems/commands/push_command" +require "rubygems/config_file" class TestGemCommandsPushCommand < Gem::TestCase def setup @@ -157,7 +158,7 @@ class TestGemCommandsPushCommand < Gem::TestCase } File.open Gem.configuration.credentials_path, "w" do |f| - f.write keys.to_yaml + f.write Gem::ConfigFile.dump_with_rubygems_yaml(keys) end Gem.configuration.load_api_keys @@ -191,7 +192,7 @@ class TestGemCommandsPushCommand < Gem::TestCase } File.open Gem.configuration.credentials_path, "w" do |f| - f.write keys.to_yaml + f.write Gem::ConfigFile.dump_with_rubygems_yaml(keys) end Gem.configuration.load_api_keys @@ -232,7 +233,7 @@ class TestGemCommandsPushCommand < Gem::TestCase } File.open Gem.configuration.credentials_path, "w" do |f| - f.write keys.to_yaml + f.write Gem::ConfigFile.dump_with_rubygems_yaml(keys) end Gem.configuration.load_api_keys @@ -273,7 +274,7 @@ class TestGemCommandsPushCommand < Gem::TestCase } File.open Gem.configuration.credentials_path, "w" do |f| - f.write keys.to_yaml + f.write Gem::ConfigFile.dump_with_rubygems_yaml(keys) end Gem.configuration.load_api_keys @@ -303,7 +304,7 @@ class TestGemCommandsPushCommand < Gem::TestCase } File.open Gem.configuration.credentials_path, "w" do |f| - f.write keys.to_yaml + f.write Gem::ConfigFile.dump_with_rubygems_yaml(keys) end Gem.configuration.load_api_keys diff --git a/test/rubygems/test_gem_gemcutter_utilities.rb b/test/rubygems/test_gem_gemcutter_utilities.rb index f5dd46e887..d266bc7f92 100644 --- a/test/rubygems/test_gem_gemcutter_utilities.rb +++ b/test/rubygems/test_gem_gemcutter_utilities.rb @@ -4,6 +4,7 @@ require_relative "helper" require "rubygems" require "rubygems/command" require "rubygems/gemcutter_utilities" +require "rubygems/config_file" class TestGemGemcutterUtilities < Gem::TestCase def setup @@ -39,7 +40,7 @@ class TestGemGemcutterUtilities < Gem::TestCase } File.open Gem.configuration.credentials_path, "w" do |f| - f.write keys.to_yaml + f.write Gem::ConfigFile.dump_with_rubygems_yaml(keys) end ENV["RUBYGEMS_HOST"] = "http://rubygems.engineyard.com" @@ -53,7 +54,7 @@ class TestGemGemcutterUtilities < Gem::TestCase keys = { :rubygems_api_key => "KEY" } File.open Gem.configuration.credentials_path, "w" do |f| - f.write keys.to_yaml + f.write Gem::ConfigFile.dump_with_rubygems_yaml(keys) end Gem.configuration.load_api_keys @@ -65,7 +66,7 @@ class TestGemGemcutterUtilities < Gem::TestCase keys = { :rubygems_api_key => "KEY", :other => "OTHER" } File.open Gem.configuration.credentials_path, "w" do |f| - f.write keys.to_yaml + f.write Gem::ConfigFile.dump_with_rubygems_yaml(keys) end Gem.configuration.load_api_keys @@ -167,8 +168,10 @@ class TestGemGemcutterUtilities < Gem::TestCase api_key = "a5fdbb6ba150cbb83aad2bb2fede64cf040453903" other_api_key = "f46dbb18bb6a9c97cdc61b5b85c186a17403cdcbf" + config = Hash[:other_api_key, other_api_key] + File.open Gem.configuration.credentials_path, "w" do |f| - f.write Hash[:other_api_key, other_api_key].to_yaml + f.write Gem::ConfigFile.dump_with_rubygems_yaml(config) end util_sign_in HTTPResponseFactory.create(body: api_key, code: 200, msg: "OK") @@ -329,7 +332,7 @@ class TestGemGemcutterUtilities < Gem::TestCase def test_verify_api_key keys = { :other => "a5fdbb6ba150cbb83aad2bb2fede64cf040453903" } File.open Gem.configuration.credentials_path, "w" do |f| - f.write keys.to_yaml + f.write Gem::ConfigFile.dump_with_rubygems_yaml(keys) end Gem.configuration.load_api_keys |