Return true from FakeFS::activate! and ::deactivate!

This commit is contained in:
Scott Taylor 2010-01-12 08:36:23 -05:00
parent 8ae8692ec7
commit 491da764d1
2 changed files with 11 additions and 0 deletions

View File

@ -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

View File

@ -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