Module: FakeFS::SpecHelpers

Defined in:
lib/fakefs/spec_helpers.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(example_group) ⇒ Object



27
28
29
# File 'lib/fakefs/spec_helpers.rb', line 27

def self.extended(example_group)
  example_group.use_fakefs(example_group)
end

.included(example_group) ⇒ Object



31
32
33
# File 'lib/fakefs/spec_helpers.rb', line 31

def self.included(example_group)
  example_group.extend self
end

Instance Method Details

#use_fakefs(describe_block) ⇒ Object



35
36
37
38
39
40
41
42
43
44
# File 'lib/fakefs/spec_helpers.rb', line 35

def use_fakefs(describe_block)
  describe_block.before :each do
    FakeFS.activate!
  end

  describe_block.after :each do
    FakeFS.deactivate!
    FakeFS::FileSystem.clear
  end
end