@@ -50,10 +50,12 @@ def test_initialize_cert_chain_path
5050 end
5151
5252 def test_initialize_default
53- private_key_path = File . join Gem . user_home , 'gem-private_key.pem'
53+ FileUtils . mkdir_p File . join ( Gem . user_home , '.gem' )
54+
55+ private_key_path = File . join Gem . user_home , '.gem' , 'gem-private_key.pem'
5456 Gem ::Security . write PRIVATE_KEY , private_key_path
5557
56- public_cert_path = File . join Gem . user_home , 'gem-public_cert.pem'
58+ public_cert_path = File . join Gem . user_home , '.gem' , ' gem-public_cert.pem'
5759 Gem ::Security . write PUBLIC_CERT , public_cert_path
5860
5961 signer = Gem ::Security ::Signer . new nil , nil
@@ -120,12 +122,12 @@ def test_sign_expired
120122 end
121123
122124 def test_sign_expired_auto_update
123- FileUtils . mkdir_p Gem . user_home , :mode => 0700
125+ FileUtils . mkdir_p File . join ( Gem . user_home , '.gem' ) , :mode => 0700
124126
125- private_key_path = File . join ( Gem . user_home , 'gem-private_key.pem' )
127+ private_key_path = File . join ( Gem . user_home , '.gem' , ' gem-private_key.pem')
126128 Gem ::Security . write PRIVATE_KEY , private_key_path
127129
128- cert_path = File . join Gem . user_home , 'gem-public_cert.pem'
130+ cert_path = File . join Gem . user_home , '.gem' , ' gem-public_cert.pem'
129131 Gem ::Security . write EXPIRED_CERT , cert_path
130132
131133 signer = Gem ::Security ::Signer . new PRIVATE_KEY , [ EXPIRED_CERT ]
@@ -140,14 +142,14 @@ def test_sign_expired_auto_update
140142 expiry = EXPIRED_CERT . not_after . strftime "%Y%m%d%H%M%S"
141143
142144 expired_path =
143- File . join Gem . user_home , "gem-public_cert.pem.expired.#{ expiry } "
145+ File . join Gem . user_home , '.gem' , "gem-public_cert.pem.expired.#{ expiry } "
144146
145147 assert_path_exists expired_path
146148 assert_equal EXPIRED_CERT . to_pem , File . read ( expired_path )
147149 end
148150
149151 def test_sign_expired_auto_update_exists
150- FileUtils . mkdir_p Gem . user_home , :mode => 0700
152+ FileUtils . mkdir_p File . join ( Gem . user_home , '.gem' ) , :mode => 0700
151153
152154 expiry = EXPIRED_CERT . not_after . strftime "%Y%m%d%H%M%S"
153155 expired_path =
0 commit comments