activate! & deactivate! state properly in tests (which allows easy replication of bug reported in #24)
This commit is contained in:
parent
c2ccf482b9
commit
8355d15ec2
@ -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
|
||||
|
@ -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'
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user