[前][次][番号順一覧][スレッド一覧]

ruby-changes:56342

From: Nobuyoshi <ko1@a...>
Date: Tue, 2 Jul 2019 15:02:54 +0900 (JST)
Subject: [ruby-changes:56342] Nobuyoshi Nakada: 6ffef8d459 (master): Clean up temporary expired cert file

https://git.ruby-lang.org/ruby.git/commit/?id=6ffef8d459

From 6ffef8d459e6423bf4fe35cccb24345bad862448 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Tue, 2 Jul 2019 14:41:34 +0900
Subject: Clean up temporary expired cert file


diff --git a/test/rubygems/test_gem_commands_cert_command.rb b/test/rubygems/test_gem_commands_cert_command.rb
index e9e1a35..fd1e66b 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 https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_cert_command.rb#L30
     @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 https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_cert_command.rb#L605
     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 https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_cert_command.rb#L637
     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[
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]