Skip to content
This repository
Browse code

Add test to ensure good perms on user's credentials file

  • Loading branch information...
commit 09a34ca2a35a49748ebea09a263cb00dfd2b9d6c 1 parent b94513b
Kendall Gifford zettabyte authored

Showing 1 changed file with 5 additions and 3 deletions. Show diff stats Hide diff stats

  1. +5 3 test/rubygems/test_gem_config_file.rb
8 test/rubygems/test_gem_config_file.rb
@@ -309,10 +309,12 @@ def test_load_api_keys_from_config
309 309 :other => 'a5fdbb6ba150cbb83aad2bb2fede64c'}, @cfg.api_keys)
310 310 end
311 311
312   - def test_save_credentials_with_strict_permissions
  312 + def test_save_credentials_file_with_strict_permissions
313 313 util_config_file
314   - @cfg
315   - assert_equal mask, File.stat(path).mode unless win_platform?
  314 + FileUtils.mkdir File.dirname(@cfg.credentials_path)
  315 + @cfg.rubygems_api_key = '701229f217cdf23b1344c7b4b54ca97'
  316 + mode = 0100600 & (~File.umask)
  317 + assert_equal mode, File.stat(@cfg.credentials_path).mode unless win_platform?
316 318 end
317 319
318 320 def util_config_file(args = @cfg_args)

0 comments on commit 09a34ca

Please sign in to comment.
Something went wrong with that request. Please try again.