aboutsummaryrefslogtreecommitdiffstats
path: root/test/rubygems/test_gem_security.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-13 19:58:57 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-13 19:58:57 +0000
commit1daa0b113d853bfa57b776cc569939b61ca14292 (patch)
treef8c4acb08a551820299dff2b13966d6ac38d31e4 /test/rubygems/test_gem_security.rb
parent85995e88d49c442b5b113c2676456133e79f5c02 (diff)
downloadruby-1daa0b113d853bfa57b776cc569939b61ca14292.tar.gz
* lib/rubygems: Update to RubyGems 2.1.3
Fixed installing platform gems Restored concurrent requires Fixed installing gems with extensions with --install-dir Fixed `gem fetch -v` to install the latest version Fixed installing gems with "./" in their files entries * test/rubygems/test_gem_package.rb: Tests for the above. * NEWS: Updated for RubyGems 2.1.3 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems/test_gem_security.rb')
-rw-r--r--test/rubygems/test_gem_security.rb60
1 files changed, 2 insertions, 58 deletions
diff --git a/test/rubygems/test_gem_security.rb b/test/rubygems/test_gem_security.rb
index b8747b79c3..737881d7bc 100644
--- a/test/rubygems/test_gem_security.rb
+++ b/test/rubygems/test_gem_security.rb
@@ -2,10 +2,6 @@ require 'rubygems/test_case'
require 'rubygems/security'
require 'rubygems/fix_openssl_warnings' if RUBY_VERSION < "1.9"
-unless defined?(OpenSSL::SSL) then
- warn 'Skipping Gem::Security tests. openssl not found.'
-end
-
class TestGemSecurity < Gem::TestCase
CHILD_KEY = load_key 'child'
@@ -99,7 +95,7 @@ class TestGemSecurity < Gem::TestCase
end
def test_class_create_key
- key = @SEC.create_key 1024
+ key = @SEC.create_key 256
assert_kind_of OpenSSL::PKey::RSA, key
end
@@ -250,57 +246,5 @@ class TestGemSecurity < Gem::TestCase
assert_equal expected, trust_dir.dir
end
- def test_class_write
- key = @SEC.create_key 1024
-
- path = File.join @tempdir, 'test-private_key.pem'
-
- @SEC.write key, path
-
- assert_path_exists path
-
- key_from_file = File.read path
-
- assert_equal key.to_pem, key_from_file
- end
-
- def test_class_write_encrypted
- key = @SEC.create_key 1024
-
- path = File.join @tempdir, 'test-private_encrypted_key.pem'
-
- passphrase = 'It should be long.'
-
- @SEC.write key, path, 0600, passphrase
-
- assert_path_exists path
-
- key_from_file = OpenSSL::PKey::RSA.new File.read(path), passphrase
-
- assert_equal key.to_pem, key_from_file.to_pem
- end
-
- def test_class_write_encrypted_cipher
- key = @SEC.create_key 1024
-
- path = File.join @tempdir, 'test-private_encrypted__with_non_default_cipher_key.pem'
-
- passphrase = 'It should be long.'
-
- cipher = OpenSSL::Cipher.new 'AES-192-CBC'
-
- @SEC.write key, path, 0600, passphrase, cipher
-
- assert_path_exists path
-
- key_file_contents = File.read(path)
-
- assert key_file_contents.split("\n")[2].match(cipher.name)
-
- key_from_file = OpenSSL::PKey::RSA.new key_file_contents, passphrase
-
- assert_equal key.to_pem, key_from_file.to_pem
- end
-
-end if defined?(OpenSSL::SSL)
+end