From 491da764d1500fbfcbf8f9e2242c07593af57a29 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Tue, 12 Jan 2010 08:36:23 -0500 Subject: [PATCH] Return true from FakeFS::activate! and ::deactivate! --- lib/fakefs/base.rb | 2 ++ test/fakefs_test.rb | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/lib/fakefs/base.rb b/lib/fakefs/base.rb index ee4dc3e..7e83e76 100644 --- a/lib/fakefs/base.rb +++ b/lib/fakefs/base.rb @@ -16,6 +16,7 @@ module FakeFS const_set(:FileUtils, FakeFS::FileUtils) const_set(:FileTest, FakeFS::FileTest) end + true end def self.deactivate! @@ -30,6 +31,7 @@ module FakeFS const_set(:FileTest, RealFileTest) const_set(:FileUtils, RealFileUtils) end + true end end diff --git a/test/fakefs_test.rb b/test/fakefs_test.rb index 203a582..774f829 100644 --- a/test/fakefs_test.rb +++ b/test/fakefs_test.rb @@ -1370,6 +1370,15 @@ class FakeFSTest < Test::Unit::TestCase assert !Pathname.new("bar").exist? end + def test_activating_returns_true + FakeFS.deactivate! + assert_equal true, FakeFS.activate! + end + + def test_deactivating_returns_true + assert_equal true, FakeFS.deactivate! + end + def here(fname) RealFile.expand_path(File.join(RealFile.dirname(__FILE__), fname)) end