From 5d2671d2bc4b0009d8d2b419369f80f9c2ada1e8 Mon Sep 17 00:00:00 2001 From: akr Date: Wed, 24 Oct 2007 05:55:26 +0000 Subject: use Dir.mktmpdir. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/pathname/test_pathname.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'test/pathname/test_pathname.rb') diff --git a/test/pathname/test_pathname.rb b/test/pathname/test_pathname.rb index 206a0eb108..9bc780f6d3 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) -- cgit v1.2.3