Module: DeltaTest::SpecHelpers

Defined in:
lib/delta_test/spec_helpers.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(example) ⇒ Object

Extend



29
30
31
# File 'lib/delta_test/spec_helpers.rb', line 29

def self.extended(example)
  example.use_delta_test(example)
end

.included(example) ⇒ Object

Include calls ‘extend` internally



39
40
41
# File 'lib/delta_test/spec_helpers.rb', line 39

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

Instance Method Details

#use_delta_test(example) ⇒ Object

Setup generator and hook profiler on contexts



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/delta_test/spec_helpers.rb', line 9

def use_delta_test(example)
  generator = DeltaTest::GeneratorSingleton.instance
  generator.setup!

  example.before(:all) do
    generator.start!(example.file_path)
  end

  example.after(:all) do
    generator.stop!
  end

  generator.hook_on_exit
end