summaryrefslogtreecommitdiff
path: root/test/fileutils/test_nowrite.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/fileutils/test_nowrite.rb')
-rw-r--r--test/fileutils/test_nowrite.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/fileutils/test_nowrite.rb b/test/fileutils/test_nowrite.rb
index d475c3ab028..830fd83c9eb 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