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
|
include FakeFS
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
|
FakeFS.activate!
|
||||||
FileSystem.clear
|
FileSystem.clear
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def teardown
|
||||||
|
FakeFS.deactivate!
|
||||||
|
end
|
||||||
|
|
||||||
def test_can_be_initialized_empty
|
def test_can_be_initialized_empty
|
||||||
fs = FileSystem
|
fs = FileSystem
|
||||||
assert_equal 0, fs.files.size
|
assert_equal 0, fs.files.size
|
||||||
|
@ -5,6 +5,10 @@ class FakeFSSafeTest < Test::Unit::TestCase
|
|||||||
FakeFS.deactivate!
|
FakeFS.deactivate!
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def teardown
|
||||||
|
FakeFS.activate!
|
||||||
|
end
|
||||||
|
|
||||||
def test_FakeFS_method_does_not_intrude_on_global_namespace
|
def test_FakeFS_method_does_not_intrude_on_global_namespace
|
||||||
path = '/path/to/file.txt'
|
path = '/path/to/file.txt'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user