summaryrefslogtreecommitdiff
path: root/test/test_tmpdir.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-07-13 21:26:06 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2020-09-14 18:22:09 +0900
commit04de778ef157c472dfa31239e8a6cfabceae4cb0 (patch)
treea6d51bb9810848b8e4ea303bbd920959083c99e0 /test/test_tmpdir.rb
parentf7f849e30cbf462e521b0843a9bb2cbea1bd4d11 (diff)
[ruby/tmpdir] Test "not a directory" cases
https://github.com/ruby/tmpdir/commit/f335f2c23e
Diffstat (limited to 'test/test_tmpdir.rb')
-rw-r--r--test/test_tmpdir.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/test_tmpdir.rb b/test/test_tmpdir.rb
index 039b5be..45342c4 100644
--- a/test/test_tmpdir.rb
+++ b/test/test_tmpdir.rb
@@ -19,6 +19,12 @@ class TestTmpdir < Test::Unit::TestCase
oldenv = envs.each_with_object({}) {|v, h| h[v] = ENV.delete(v)}
begin
envs.each do |e|
+ tmpdirx = File.join(tmpdir, e)
+ ENV[e] = tmpdirx
+ assert_not_equal(tmpdirx, Dir.tmpdir)
+ File.write(tmpdirx, "")
+ assert_not_equal(tmpdirx, Dir.tmpdir)
+ File.unlink(tmpdirx)
ENV[e] = tmpdir
assert_equal(tmpdir, Dir.tmpdir)
File.chmod(0777, tmpdir)