summaryrefslogtreecommitdiff
path: root/test/pathname
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-10-24 05:55:26 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-10-24 05:55:26 +0000
commit5d2671d2bc4b0009d8d2b419369f80f9c2ada1e8 (patch)
treeff1df4fd9c26ddb398fd42dbc0b14353c5f23b25 /test/pathname
parent124bdf881594b09dc5748d0dec4e27519aac5c68 (diff)
use Dir.mktmpdir.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/pathname')
-rw-r--r--test/pathname/test_pathname.rb8
1 files changed, 2 insertions, 6 deletions
diff --git a/test/pathname/test_pathname.rb b/test/pathname/test_pathname.rb
index 206a0eb..9bc780f 100644
--- a/test/pathname/test_pathname.rb
+++ b/test/pathname/test_pathname.rb
@@ -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)