Class: Cucumber::Formatter::Progress

Inherits:
Object
  • Object
show all
Includes:
Console, Io
Defined in:
lib/cucumber/formatter/progress.rb

Overview

The formatter used for --format progress

Direct Known Subclasses

Usage

Constant Summary

Constants included from Console

Console::FORMATS

Constants included from ANSIColor

ANSIColor::ALIASES

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Io

#ensure_dir, #ensure_file, #ensure_io

Methods included from Console

#announce, #embed, #empty_announcements, #format_step, #format_string, #print_announcement, #print_announcements, #print_counts, #print_elements, #print_exception, #print_passing_wip, #print_snippets, #print_stats, #print_steps, #print_table_row_announcements

Methods included from ANSIColor

#cukes, define_grey, define_real_grey, #green_cukes, #grey, #red_cukes, #yellow_cukes

Methods included from Summary

#scenario_summary, #step_summary

Methods included from Duration

#format_duration

Constructor Details

#initialize(step_mother, path_or_io, options) ⇒ Progress

Returns a new instance of Progress.



12
13
14
# File 'lib/cucumber/formatter/progress.rb', line 12

def initialize(step_mother, path_or_io, options)
  @step_mother, @io, @options = step_mother, ensure_io(path_or_io, "progress"), options
end

Instance Attribute Details

#step_motherObject (readonly)

Returns the value of attribute step_mother.



10
11
12
# File 'lib/cucumber/formatter/progress.rb', line 10

def step_mother
  @step_mother
end

Instance Method Details

#after_feature_element(*args) ⇒ Object



26
27
28
29
# File 'lib/cucumber/formatter/progress.rb', line 26

def after_feature_element(*args)
  progress(:failed) if @exception_raised
  @exception_raised = false
end

#after_features(features) ⇒ Object



16
17
18
19
20
# File 'lib/cucumber/formatter/progress.rb', line 16

def after_features(features)
  @io.puts
  @io.puts
  print_summary(features)
end

#after_outline_table(outline_table) ⇒ Object



49
50
51
# File 'lib/cucumber/formatter/progress.rb', line 49

def after_outline_table(outline_table)
  @outline_table = nil
end

#after_step_result(keyword, step_match, multiline_arg, status, exception, source_indent, background) ⇒ Object



40
41
42
43
# File 'lib/cucumber/formatter/progress.rb', line 40

def after_step_result(keyword, step_match, multiline_arg, status, exception, source_indent, background)
  progress(status)
  @status = status
end

#after_steps(*args) ⇒ Object



36
37
38
# File 'lib/cucumber/formatter/progress.rb', line 36

def after_steps(*args)
  @exception_raised = false
end

#before_feature_element(*args) ⇒ Object



22
23
24
# File 'lib/cucumber/formatter/progress.rb', line 22

def before_feature_element(*args)
  @exception_raised = false
end

#before_outline_table(outline_table) ⇒ Object



45
46
47
# File 'lib/cucumber/formatter/progress.rb', line 45

def before_outline_table(outline_table)
  @outline_table = outline_table
end

#before_steps(*args) ⇒ Object



31
32
33
34
# File 'lib/cucumber/formatter/progress.rb', line 31

def before_steps(*args)
  progress(:failed) if @exception_raised
  @exception_raised = false
end

#exception(*args) ⇒ Object



59
60
61
# File 'lib/cucumber/formatter/progress.rb', line 59

def exception(*args)
  @exception_raised = true
end

#table_cell_value(value, status) ⇒ Object



53
54
55
56
57
# File 'lib/cucumber/formatter/progress.rb', line 53

def table_cell_value(value, status)
  return unless @outline_table
  status ||= @status
  progress(status) unless table_header_cell?(status)
end