diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | lib/rubygems/test_case.rb | 15 |
2 files changed, 18 insertions, 3 deletions
@@ -1,3 +1,9 @@ +Thu Nov 29 16:18:14 2012 Eric Hodel <drbrain@segment7.net> + + * lib/rubygems/test_case.rb: Disable loading of keys and certificates + outside rubygems or ruby tests as the files are not available (or + necessary). + Thu Nov 29 16:14:41 2012 Koichi Sasada <ko1@atdot.net> * vm_backtrace.c (rb_debug_inspector_open): use RARRAY_LENINT() for 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 |