diff --git a/test/fakefs_test.rb b/test/fakefs_test.rb index a0863a4..67ab301 100644 --- a/test/fakefs_test.rb +++ b/test/fakefs_test.rb @@ -4,9 +4,14 @@ class FakeFSTest < Test::Unit::TestCase include FakeFS def setup + FakeFS.activate! FileSystem.clear end + def teardown + FakeFS.deactivate! + end + def test_can_be_initialized_empty fs = FileSystem assert_equal 0, fs.files.size diff --git a/test/safe_test.rb b/test/safe_test.rb index 9db2de0..f16dc4e 100644 --- a/test/safe_test.rb +++ b/test/safe_test.rb @@ -5,6 +5,10 @@ class FakeFSSafeTest < Test::Unit::TestCase FakeFS.deactivate! end + def teardown + FakeFS.activate! + end + def test_FakeFS_method_does_not_intrude_on_global_namespace path = '/path/to/file.txt'