[ruby/tmpdir] Test "not writable" case

https://github.com/ruby/tmpdir/commit/84684d80f9
This commit is contained in:
Nobuyoshi Nakada 2020-07-13 21:39:32 +09:00 committed by Hiroshi SHIBATA
parent 04de778ef1
commit df1c035d03
1 changed files with 2 additions and 0 deletions

View File

@ -27,6 +27,8 @@ class TestTmpdir < Test::Unit::TestCase
File.unlink(tmpdirx)
ENV[e] = tmpdir
assert_equal(tmpdir, Dir.tmpdir)
File.chmod(0555, tmpdir)
assert_not_equal(tmpdir, Dir.tmpdir)
File.chmod(0777, tmpdir)
assert_not_equal(tmpdir, Dir.tmpdir)
newdir = Dir.mktmpdir("d", tmpdir) do |dir|