1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Use mock of Gem::Security::OPT[:trust_dir]

Gem::Security::OPT[:trust_dir] depends Gem.user_home but doesn't reset
on setup/teardown.
NOTE: Gem.user_home won't be recovered now, so teardown doesn't work.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2012-04-18 23:14:26 +00:00
parent 7cfc4be298
commit 61c1fb7058

View file

@ -4,6 +4,16 @@ require 'rubygems/fix_openssl_warnings' if RUBY_VERSION < "1.9"
class TestGemSecurity < Gem::TestCase
def setup
super
Gem::Security::OPT[:trust_dir] = File.join(Gem.user_home, '.gem', 'trust')
end
def teardown
super
Gem::Security::OPT[:trust_dir] = File.join(Gem.user_home, '.gem', 'trust')
end
def test_class_build_cert
name = OpenSSL::X509::Name.parse "CN=nobody/DC=example"
key = OpenSSL::PKey::RSA.new 512