Create the test file under the created temporary directory

Fixes https://github.com/ruby/ruby/pull/4255
This commit is contained in:
Nobuyoshi Nakada 2021-03-11 09:21:21 +09:00
parent ef88225886
commit a6b5d70bca
No known key found for this signature in database
GPG Key ID: 7CD2805BFA3770C6

View File

@ -680,7 +680,7 @@ class TestFileExhaustive < Test::Unit::TestCase
assert_equal(t + 1, File.atime(zerofile))
assert_equal(t + 2, File.mtime(zerofile))
Dir.mktmpdir do |dir|
Dir.chdir do
Dir.chdir(dir) do
path = "foo\u{30b3 30d4 30fc}"
File.write(path, "") rescue next
assert_equal(1, File.utime(nil, nil, path))