mirror of
https://github.com/ruby/ruby.git
synced 2026-01-27 04:24:23 +00:00
Clean up temporary expired cert file
This commit is contained in:
parent
92dcee393a
commit
6ffef8d459
@ -30,6 +30,14 @@ class TestGemCommandsCertCommand < Gem::TestCase
|
||||
@cmd = Gem::Commands::CertCommand.new
|
||||
|
||||
@trust_dir = Gem::Security.trust_dir
|
||||
|
||||
@cleanup = []
|
||||
end
|
||||
|
||||
def teardown
|
||||
FileUtils.rm_f(@cleanup)
|
||||
|
||||
super
|
||||
end
|
||||
|
||||
def test_certificates_matching
|
||||
@ -597,6 +605,7 @@ ERROR: --private-key not specified and ~/.gem/gem-private_key.pem does not exis
|
||||
assert_equal '/CN=nobody/DC=example', EXPIRED_PUBLIC_CERT.issuer.to_s
|
||||
|
||||
tmp_expired_cert_file = File.join(Dir.tmpdir, File.basename(EXPIRED_PUBLIC_CERT_FILE))
|
||||
@cleanup << tmp_expired_cert_file
|
||||
File.write(tmp_expired_cert_file, File.read(EXPIRED_PUBLIC_CERT_FILE))
|
||||
|
||||
@cmd.handle_options %W[
|
||||
@ -628,6 +637,7 @@ ERROR: --private-key not specified and ~/.gem/gem-private_key.pem does not exis
|
||||
assert_equal '/CN=nobody/DC=example', EXPIRED_PUBLIC_CERT.issuer.to_s
|
||||
|
||||
tmp_expired_cert_file = File.join(Dir.tmpdir, File.basename(EXPIRED_PUBLIC_CERT_FILE))
|
||||
@cleanup << tmp_expired_cert_file
|
||||
File.write(tmp_expired_cert_file, File.read(EXPIRED_PUBLIC_CERT_FILE))
|
||||
|
||||
@cmd.handle_options %W[
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user