From 2296655ca9f8d51ef80faabe76980fa517e6a245 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Fri, 4 Dec 2009 04:50:04 -0500 Subject: [PATCH] Call FakeFS.activate! && FakeFS.deactivate! when surrounding RealFileUtils - "test/subdir" was accidentally being created on the file system --- test/fakefs_test.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/fakefs_test.rb b/test/fakefs_test.rb index 2acb97a..6172622 100644 --- a/test/fakefs_test.rb +++ b/test/fakefs_test.rb @@ -797,7 +797,9 @@ class FakeFSTest < Test::Unit::TestCase assert File.exists?(here('subdir')), 'subdir was cloned' assert File.directory?(here('subdir')), 'subdir is a directory' ensure - RealFileUtils.rm_rf(here('subdir')) if RealFile.exists?(here('subdir')) + FakeFS.deactivate! + RealFileUtils.rm_rf(here('subdir')) + FakeFS.activate! end def test_clone_clones_dot_files_even_hard_to_find_ones @@ -811,7 +813,9 @@ class FakeFSTest < Test::Unit::TestCase assert_equal ['.bar'], FileSystem.find(here('subdir')).keys assert_equal ['foo'], FileSystem.find(here('subdir/.bar/baz/.quux')).keys ensure - RealFileUtils.rm_rf(here('subdir')) if RealFile.exists?(here('subdir')) + FakeFS.deactivate! + RealFileUtils.rm_rf(here('subdir')) + FakeFS.activate! end def test_putting_a_dot_at_end_copies_the_contents