Module: Viewcumber::Cucumber010

Included in:
Viewcumber
Defined in:
lib/viewcumber.rb

Instance Method Summary collapse

Instance Method Details

#after_feature(feature) ⇒ Object

The JSON formatter adds the background as a feature element, we only want full scenarios so lets delete all with type ‘background’



43
44
45
46
47
48
# File 'lib/viewcumber.rb', line 43

def after_feature(feature)
  @gf.gherkin_object['elements'].delete_if do |element|
    element['type'] == 'background'
  end
  super(feature)
end

#after_step(step) ⇒ Object



32
33
34
35
36
37
38
39
# File 'lib/viewcumber.rb', line 32

def after_step(step)
  additional_step_info = { 'html_file' => write_html_to_file(Viewcumber.last_step_html), 
                           'emails' => emails_for_step(step) }

  current_element = @gf.gherkin_object['elements'].last
  current_step = current_element['steps'].last
  current_step.merge!(additional_step_info)
end