diff options
Diffstat (limited to 'test/pathname')
-rw-r--r-- | test/pathname/test_pathname.rb | 8 |
1 files changed, 2 insertions, 6 deletions
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) |