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

ruby-changes:65795

From: Nobuyoshi <ko1@a...>
Date: Mon, 5 Apr 2021 21:39:35 +0900 (JST)
Subject: [ruby-changes:65795] 0fb782ee38 (ruby_3_0): Get rid of multibyte prefix to tmpdir

https://git.ruby-lang.org/ruby.git/commit/?id=0fb782ee38

From 0fb782ee38ea37fd5fe8b1f775f8ad866a82a3f0 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Mon, 5 Apr 2021 21:20:51 +0900
Subject: Get rid of multibyte prefix to tmpdir

---
 test/ruby/test_require.rb | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/test/ruby/test_require.rb b/test/ruby/test_require.rb
index 30c07b9..4c8faad 100644
--- a/test/ruby/test_require.rb
+++ b/test/ruby/test_require.rb
@@ -371,15 +371,15 @@ class TestRequire < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_require.rb#L371
     bug = '[ruby-list:49994] path in ospath'
     base = "test_load\u{3042 3044 3046 3048 304a}".encode(Encoding::Windows_31J)
     path = nil
-    Tempfile.create([base, ".rb"]) do |t|
-      path = t.path
-
+    Dir.mktmpdir do |dir|
+      path = File.join(dir, base+".rb")
       assert_raise_with_message(LoadError, /#{base}/) {
-        load(File.join(File.dirname(path), base))
+        load(File.join(dir, base))
       }
 
-      t.puts "warn 'ok'"
-      t.close
+      File.open(path, "w+b") do |t|
+        t.puts "warn 'ok'"
+      end
       assert_include(path, base)
       assert_warn("ok\n", bug) {
         assert_nothing_raised(LoadError, bug) {
-- 
cgit v1.1


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

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