diff options
| author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-10-24 05:55:26 +0000 |
|---|---|---|
| committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-10-24 05:55:26 +0000 |
| commit | 0c8fdb2c40a2b9aac59e3f0cdc8fe66245984f90 (patch) | |
| tree | ff1df4fd9c26ddb398fd42dbc0b14353c5f23b25 /test/pathname/test_pathname.rb | |
| parent | f8522d0cd02834bdc37a672a9943c7eedb87fa24 (diff) | |
| download | ruby-0c8fdb2c40a2b9aac59e3f0cdc8fe66245984f90.tar.gz ruby-0c8fdb2c40a2b9aac59e3f0cdc8fe66245984f90.tar.xz ruby-0c8fdb2c40a2b9aac59e3f0cdc8fe66245984f90.zip | |
use Dir.mktmpdir.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/pathname/test_pathname.rb')
| -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 206a0eb10..9bc780f6d 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) |
