@@ -53,6 +53,7 @@ def test_initialize
5353 fp . puts ":sources:"
5454 fp . puts " - http://more-gems.example.com"
5555 fp . puts "install: --wrappers"
56+ fp . puts ":gemhome: /tmp/gems"
5657 fp . puts ":gempath:"
5758 fp . puts "- /usr/ruby/1.8/lib/ruby/gems/1.8"
5859 fp . puts "- /var/ruby/1.8/gem_home"
@@ -61,6 +62,7 @@ def test_initialize
6162 fp . puts ":cert_expiration_length_days: 28"
6263 fp . puts ":install_extension_in_lib: false"
6364 fp . puts ":ipv4_fallback_enabled: true"
65+ fp . puts ":use_psych: true"
6466 end
6567
6668 util_config_file
@@ -70,13 +72,15 @@ def test_initialize
7072 assert_equal false , @cfg . update_sources
7173 assert_equal %w[ http://more-gems.example.com ] , @cfg . sources
7274 assert_equal "--wrappers" , @cfg [ :install ]
75+ assert_equal "/tmp/gems" , @cfg . home
7376 assert_equal ( [ "/usr/ruby/1.8/lib/ruby/gems/1.8" , "/var/ruby/1.8/gem_home" ] ,
7477 @cfg . path )
7578 assert_equal 0 , @cfg . ssl_verify_mode
7679 assert_equal "/etc/ssl/certs" , @cfg . ssl_ca_cert
7780 assert_equal 28 , @cfg . cert_expiration_length_days
7881 assert_equal false , @cfg . install_extension_in_lib
7982 assert_equal true , @cfg . ipv4_fallback_enabled
83+ assert_equal true , @cfg . use_psych
8084 end
8185
8286 def test_initialize_ipv4_fallback_enabled_env
@@ -105,17 +109,27 @@ def test_initialize_global_gem_cache_env
105109
106110 def test_initialize_global_gem_cache_gemrc
107111 File . open @temp_conf , "w" do |fp |
108- fp . puts "global_gem_cache: true"
112+ fp . puts ": global_gem_cache: true"
109113 end
110114
111115 util_config_file %W[ --config-file #{ @temp_conf } ]
112116
113117 assert_equal true , @cfg . global_gem_cache
114118 end
115119
120+ def test_initialize_use_psych_env
121+ orig_use_psych = ENV [ "RUBYGEMS_USE_PSYCH" ]
122+ ENV [ "RUBYGEMS_USE_PSYCH" ] = "true"
123+ util_config_file %W[ --config-file #{ @temp_conf } ]
124+
125+ assert_equal true , @cfg . use_psych
126+ ensure
127+ ENV [ "RUBYGEMS_USE_PSYCH" ] = orig_use_psych
128+ end
129+
116130 def test_initialize_concurrent_downloads
117131 File . open @temp_conf , "w" do |fp |
118- fp . puts "concurrent_downloads: 2"
132+ fp . puts ": concurrent_downloads: 2"
119133 end
120134
121135 util_config_file %W[ --config-file #{ @temp_conf } ]
0 commit comments