diff --git a/ChangeLog b/ChangeLog index 403c4411bd..2f18d63dff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Dec 24 11:26:41 2003 Nobuyoshi Nakada + + * test/fileutils/test_fileutils.rb: should not create any + files or directories in current directory. [ruby-talk:88724] + Wed Dec 24 10:29:53 2003 Nobuyoshi Nakada * ext/stringio/stringio.c (strio_read): never return nil at diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb index 03d4f1a1ba..90a496124b 100644 --- a/test/fileutils/test_fileutils.rb +++ b/test/fileutils/test_fileutils.rb @@ -10,6 +10,15 @@ require 'pathname' require 'tmpdir' require 'test/unit' +class TestFileUtils < Test::Unit::TestCase + TMPROOT = "#{Dir.tmpdir}/fileutils.rb.#{$$}" +end + +prevdir = Dir.pwd +tmproot = TestFileUtils::TMPROOT +Dir.mkdir tmproot unless File.directory?(tmproot) +Dir.chdir tmproot + def have_drive_letter? /djgpp|mswin(?!ce)|mingw|bcc|emx/ === RUBY_PLATFORM end @@ -44,7 +53,10 @@ def have_hardlink? HAVE_HARDLINK end -class TestFileUtils < Test::Unit::TestCase +Dir.chdir prevdir +Dir.rmdir tmproot + +class TestFileUtils include FileUtils