summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-04-05 21:20:51 +0900
committerNARUSE, Yui <naruse@airemix.jp>2021-04-05 21:33:42 +0900
commit0fb782ee38ea37fd5fe8b1f775f8ad866a82a3f0 (patch)
tree20b5dc193188ab6182be3c8414a016f805575823
parent6cdc36a60d7fbf4b218785087b1c3a91682bc147 (diff)
Get rid of multibyte prefix to tmpdirv3_0_1
-rw-r--r--test/ruby/test_require.rb12
1 files 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
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) {