diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-09-23 05:27:38 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-09-23 05:27:38 +0000 |
commit | daeb011380b1eb899f37cf83676cc3e9be98c5f7 (patch) | |
tree | 71c92b4c0e890c88d059a7294a1da131c5c3e290 /test/fileutils/test_fileutils.rb | |
parent | 681cdb7f7b3efced63d365d8568c32df4817d40a (diff) | |
download | ruby-daeb011380b1eb899f37cf83676cc3e9be98c5f7.tar.gz |
test_fileutils.rb: use Dir.mktmpdir
* test/fileutils/test_fileutils.rb: use Dir.mktmpdir instead of
fixed name for temporary directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/fileutils/test_fileutils.rb')
-rw-r--r-- | test/fileutils/test_fileutils.rb | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb index 63a4590cf0..00441a4cfb 100644 --- a/test/fileutils/test_fileutils.rb +++ b/test/fileutils/test_fileutils.rb @@ -9,7 +9,6 @@ require 'tmpdir' require 'test/unit' class TestFileUtils < Test::Unit::TestCase - TMPROOT = "#{Dir.tmpdir}/fileutils.rb.#{$$}" include Test::Unit::FileAssertions def assert_output_lines(expected, fu = self, message=nil) @@ -96,8 +95,7 @@ class TestFileUtils < Test::Unit::TestCase end begin - tmproot = TMPROOT - Dir.mkdir tmproot unless File.directory?(tmproot) + tmproot = Dir.mktmpdir "fileutils" Dir.chdir tmproot do Dir.mkdir("\n") Dir.rmdir("\n") @@ -145,8 +143,7 @@ class TestFileUtils < Test::Unit::TestCase def setup @prevdir = Dir.pwd @groups = Process.groups if have_file_perm? - tmproot = TMPROOT - mymkdir tmproot unless File.directory?(tmproot) + tmproot = @tmproot = Dir.mktmpdir "fileutils" Dir.chdir tmproot my_rm_rf 'data'; mymkdir 'data' my_rm_rf 'tmp'; mymkdir 'tmp' @@ -155,7 +152,7 @@ class TestFileUtils < Test::Unit::TestCase def teardown Dir.chdir @prevdir - my_rm_rf TMPROOT + my_rm_rf @tmproot end |