diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-29 07:18:26 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-29 07:18:26 +0000 |
commit | d9422d8721d003d81ba00b8843e7c39c1359880e (patch) | |
tree | 04413843dd73368a76f5e2ec17f56ae3af468e06 /lib | |
parent | e8af0046b72bb5a1da549a90888b445525d6cfff (diff) | |
download | ruby-d9422d8721d003d81ba00b8843e7c39c1359880e.tar.gz |
* lib/rubygems/test_case.rb: Disable loading of keys and certificates
outside rubygems or ruby tests as the files are not available (or
necessary).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rubygems/test_case.rb | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/rubygems/test_case.rb b/lib/rubygems/test_case.rb index ace0177e19..8d34a03e84 100644 --- a/lib/rubygems/test_case.rb +++ b/lib/rubygems/test_case.rb @@ -1006,9 +1006,18 @@ Also, a list: File.expand_path "../../../test/rubygems/#{key_name}_key.pem", __FILE__ end - PRIVATE_KEY = load_key 'private' - PUBLIC_KEY = PRIVATE_KEY.public_key + # :stopdoc: + # only available in RubyGems tests - PUBLIC_CERT = load_cert 'public' + begin + PRIVATE_KEY = load_key 'private' + PUBLIC_KEY = PRIVATE_KEY.public_key + + PUBLIC_CERT = load_cert 'public' + rescue Errno::ENOENT + PRIVATE_KEY = nil + PUBLIC_KEY = nil + PUBLIC_CERT = nil + end end |