Skip to content

Commit 0fb782e

Browse files
nobunurse
authored andcommitted
Get rid of multibyte prefix to tmpdir
1 parent 6cdc36a commit 0fb782e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/ruby/test_require.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -371,15 +371,15 @@ def test_load_ospath
371371
bug = '[ruby-list:49994] path in ospath'
372372
base = "test_load\u{3042 3044 3046 3048 304a}".encode(Encoding::Windows_31J)
373373
path = nil
374-
Tempfile.create([base, ".rb"]) do |t|
375-
path = t.path
376-
374+
Dir.mktmpdir do |dir|
375+
path = File.join(dir, base+".rb")
377376
assert_raise_with_message(LoadError, /#{base}/) {
378-
load(File.join(File.dirname(path), base))
377+
load(File.join(dir, base))
379378
}
380379

381-
t.puts "warn 'ok'"
382-
t.close
380+
File.open(path, "w+b") do |t|
381+
t.puts "warn 'ok'"
382+
end
383383
assert_include(path, base)
384384
assert_warn("ok\n", bug) {
385385
assert_nothing_raised(LoadError, bug) {

0 commit comments

Comments
 (0)