1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

use Dir.mktmpdir.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2007-10-24 05:55:26 +00:00
parent 124bdf8815
commit 5d2671d2bc
3 changed files with 23 additions and 27 deletions

View file

@ -287,16 +287,12 @@ class TestPathname < Test::Unit::TestCase
return
rescue TypeError
end
dir = "#{Dir.tmpdir}/tst-pathname-#$$"
Dir.mkdir(dir)
begin
Dir.mktmpdir {|dir|
File.symlink("not-exist-target", "#{dir}/not-exist")
assert_raise(Errno::ENOENT) { realpath("#{dir}/not-exist") }
File.symlink("loop", "#{dir}/loop")
assert_raise(Errno::ELOOP) { realpath("#{dir}/loop") }
ensure
FileUtils.rmtree(dir)
end
}
end
def descend(path)