Skip to content

Commit f335f2c

Browse files
committed
Test "not a directory" cases
1 parent 414c00e commit f335f2c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/test_tmpdir.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ def test_world_writable
1919
oldenv = envs.each_with_object({}) {|v, h| h[v] = ENV.delete(v)}
2020
begin
2121
envs.each do |e|
22+
tmpdirx = File.join(tmpdir, e)
23+
ENV[e] = tmpdirx
24+
assert_not_equal(tmpdirx, Dir.tmpdir)
25+
File.write(tmpdirx, "")
26+
assert_not_equal(tmpdirx, Dir.tmpdir)
27+
File.unlink(tmpdirx)
2228
ENV[e] = tmpdir
2329
assert_equal(tmpdir, Dir.tmpdir)
2430
File.chmod(0777, tmpdir)

0 commit comments

Comments
 (0)