Module: FakeExecution::SpecHelpers

Defined in:
lib/fake_execution/spec_helpers.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(example_group) ⇒ Object



5
6
7
# File 'lib/fake_execution/spec_helpers.rb', line 5

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

.included(example_group) ⇒ Object



9
10
11
# File 'lib/fake_execution/spec_helpers.rb', line 9

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

Instance Method Details

#use_fake_execution(describe_block) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/fake_execution/spec_helpers.rb', line 13

def use_fake_execution(describe_block)
  describe_block.before :each do
    FakeExecution.activate!
  end

  describe_block.after :each do
    FakeExecution.deactivate!
  end
end