From 4022f33416a00fd6a18989aa54f60573f48be0a0 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Thu, 9 Nov 2017 17:12:07 +0900 Subject: Use `Tempfile.create` Instead of `Dir::Tmpname.make_tmpname`, an internal method which does not guarantee uniqueness, use `Tempfile.create`. --- actionpack/test/controller/log_subscriber_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actionpack/test/controller/log_subscriber_test.rb b/actionpack/test/controller/log_subscriber_test.rb index f0f106c8ba..4c59bea193 100644 --- a/actionpack/test/controller/log_subscriber_test.rb +++ b/actionpack/test/controller/log_subscriber_test.rb @@ -98,7 +98,7 @@ class ACLogSubscriberTest < ActionController::TestCase @old_logger = ActionController::Base.logger - @cache_path = File.join Dir.tmpdir, Dir::Tmpname.make_tmpname("tmp", "cache") + @cache_path = Tempfile.create(%w"tmp cache", Dir.tmpdir) @controller.cache_store = :file_store, @cache_path ActionController::LogSubscriber.attach_to :action_controller end -- cgit v1.2.3 From 2d5700b9a3e2ac25a5ff349ca6d3dc27077cea13 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Thu, 9 Nov 2017 22:09:00 +0900 Subject: Use `Dir.mktmpdir` As `@cache_path` is expected to be a directory name, use `Dir.mktmpdir`. And omit unnecessary `Dir.tmpdir`. --- actionpack/test/controller/log_subscriber_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actionpack/test/controller/log_subscriber_test.rb b/actionpack/test/controller/log_subscriber_test.rb index 4c59bea193..cb425fb3de 100644 --- a/actionpack/test/controller/log_subscriber_test.rb +++ b/actionpack/test/controller/log_subscriber_test.rb @@ -98,7 +98,7 @@ class ACLogSubscriberTest < ActionController::TestCase @old_logger = ActionController::Base.logger - @cache_path = Tempfile.create(%w"tmp cache", Dir.tmpdir) + @cache_path = Dir.mktmpdir(%w"tmp cache") @controller.cache_store = :file_store, @cache_path ActionController::LogSubscriber.attach_to :action_controller end -- cgit v1.2.3