We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6cdc36a commit 0fb782eCopy full SHA for 0fb782e
test/ruby/test_require.rb
@@ -371,15 +371,15 @@ def test_load_ospath
371
bug = '[ruby-list:49994] path in ospath'
372
base = "test_load\u{3042 3044 3046 3048 304a}".encode(Encoding::Windows_31J)
373
path = nil
374
- Tempfile.create([base, ".rb"]) do |t|
375
- path = t.path
376
-
+ Dir.mktmpdir do |dir|
+ path = File.join(dir, base+".rb")
377
assert_raise_with_message(LoadError, /#{base}/) {
378
- load(File.join(File.dirname(path), base))
+ load(File.join(dir, base))
379
}
380
381
- t.puts "warn 'ok'"
382
- t.close
+ File.open(path, "w+b") do |t|
+ t.puts "warn 'ok'"
+ end
383
assert_include(path, base)
384
assert_warn("ok\n", bug) {
385
assert_nothing_raised(LoadError, bug) {
0 commit comments