diff options
author | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-11-25 09:13:58 +0000 |
---|---|---|
committer | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-11-25 09:13:58 +0000 |
commit | 21f5433ca124a3d28ec902e685f93c41eaa7c6ea (patch) | |
tree | d7cac90a2414dd9e04feed41a026c2f32eb1676b /test | |
parent | 85a53710ea2dc1d1842cad6c79faaed9e9400a6c (diff) | |
download | ruby-21f5433ca124a3d28ec902e685f93c41eaa7c6ea.tar.gz ruby-21f5433ca124a3d28ec902e685f93c41eaa7c6ea.tar.xz ruby-21f5433ca124a3d28ec902e685f93c41eaa7c6ea.zip |
* test/fileutils/test_fileutils.rb: chdir Dir.tmpdir before each test. [ruby-dev:22045]
* test/fileutils/test_nowrite.rb: ditto.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/fileutils/test_fileutils.rb | 6 | ||||
-rw-r--r-- | test/fileutils/test_nowrite.rb | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb index fa5bf7b7f..49e637d83 100644 --- a/test/fileutils/test_fileutils.rb +++ b/test/fileutils/test_fileutils.rb @@ -5,8 +5,9 @@ $:.unshift File.dirname(__FILE__) require 'fileutils' -require 'test/unit' require 'fileasserts' +require 'tmpdir' +require 'test/unit' def have_drive_letter? @@ -43,6 +44,8 @@ class TestFileUtils < Test::Unit::TestCase end def setup + @prevdir = Dir.pwd + Dir.chdir Dir.tmpdir my_rm_rf 'data'; Dir.mkdir 'data' my_rm_rf 'tmp'; Dir.mkdir 'tmp' prepare_data_file @@ -52,6 +55,7 @@ class TestFileUtils < Test::Unit::TestCase def teardown my_rm_rf 'data' my_rm_rf 'tmp' + Dir.chdir @prevdir end diff --git a/test/fileutils/test_nowrite.rb b/test/fileutils/test_nowrite.rb index d475c3ab0..830fd83c9 100644 --- a/test/fileutils/test_nowrite.rb +++ b/test/fileutils/test_nowrite.rb @@ -5,8 +5,9 @@ $:.unshift File.dirname(__FILE__) require 'fileutils' -require 'test/unit' require 'fileasserts' +require 'tmpdir' +require 'test/unit' class TestNoWrite < Test::Unit::TestCase @@ -25,6 +26,8 @@ class TestNoWrite < Test::Unit::TestCase COPY = 'data/copy' def setup + @prevdir = Dir.pwd + Dir.chdir Dir.tmpdir my_rm_rf 'date'; Dir.mkdir 'data' my_rm_rf 'tmp'; Dir.mkdir 'tmp' File.open(SRC, 'w') {|f| f.puts 'dummy' } @@ -34,6 +37,7 @@ class TestNoWrite < Test::Unit::TestCase def teardown my_rm_rf 'data' my_rm_rf 'tmp' + Dir.chdir @prevdir end def test_cp |