Skip to content

Commit

Permalink
Add test to ensure good perms on user's credentials file
Browse files Browse the repository at this point in the history
  • Loading branch information
zettabyte committed May 21, 2012
1 parent b94513b commit 09a34ca
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/rubygems/test_gem_config_file.rb
Expand Up @@ -309,10 +309,12 @@ def test_load_api_keys_from_config
:other => 'a5fdbb6ba150cbb83aad2bb2fede64c'}, @cfg.api_keys)
end

def test_save_credentials_with_strict_permissions
def test_save_credentials_file_with_strict_permissions
util_config_file
@cfg
assert_equal mask, File.stat(path).mode unless win_platform?
FileUtils.mkdir File.dirname(@cfg.credentials_path)
@cfg.rubygems_api_key = '701229f217cdf23b1344c7b4b54ca97'
mode = 0100600 & (~File.umask)
assert_equal mode, File.stat(@cfg.credentials_path).mode unless win_platform?
end

def util_config_file(args = @cfg_args)
Expand Down

0 comments on commit 09a34ca

Please sign in to comment.