diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-07-02 14:41:34 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-07-02 15:02:16 +0900 |
commit | 6ffef8d459e6423bf4fe35cccb24345bad862448 (patch) | |
tree | b02d272e7f4eaeab69fe4caa6112323831e33388 | |
parent | 92dcee393acc33075b533a2e8f5ea24ee8a5f579 (diff) |
Clean up temporary expired cert file
-rw-r--r-- | test/rubygems/test_gem_commands_cert_command.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/rubygems/test_gem_commands_cert_command.rb b/test/rubygems/test_gem_commands_cert_command.rb index e9e1a353c1..fd1e66b915 100644 --- a/test/rubygems/test_gem_commands_cert_command.rb +++ b/test/rubygems/test_gem_commands_cert_command.rb @@ -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[ |