From 52975bb7a77b3a6409e50609b4baeafade035b3d Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 24 Dec 2003 02:26:44 +0000 Subject: [PATCH] * test/fileutils/test_fileutils.rb: should not create any files or directories in current directory. [ruby-talk:88724] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ test/fileutils/test_fileutils.rb | 14 +++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) 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