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 ANSIColor

ANSIColor::ALIASES

Constants included from Term::ANSIColor

Term::ANSIColor::ATTRIBUTES, Term::ANSIColor::ATTRIBUTE_NAMES, Term::ANSIColor::COLORED_REGEXP

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Io

#ensure_dir, #ensure_file, #ensure_io

Methods included from Console

#embed, #empty_messages, #format_step, #format_string, #linebreaks, #print_elements, #print_exception, #print_message, #print_messages, #print_passing_wip, #print_profile_information, #print_snippets, #print_stats, #print_steps, #print_table_row_messages, #puts

Methods included from ANSIColor

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

Methods included from Term::ANSIColor

attributes, coloring=, coloring?, #uncolored

Methods included from Summary

#scenario_summary, #step_summary

Methods included from Duration

#format_duration

Constructor Details

#initialize(runtime, path_or_io, options) ⇒ Progress

Returns a new instance of Progress.



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

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

Instance Attribute Details

#runtimeObject (readonly)

Returns the value of attribute runtime.



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

def runtime
  @runtime
end

Instance Method Details

#after_feature_element(*args) ⇒ Object



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

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

#after_features(features) ⇒ Object



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

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

#after_outline_table(outline_table) ⇒ Object



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

def after_outline_table(outline_table)
  @outline_table = nil
end

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



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

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

#after_steps(*args) ⇒ Object



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

def after_steps(*args)
  @exception_raised = false
end

#before_feature_element(*args) ⇒ Object



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

def before_feature_element(*args)
  @exception_raised = false
end

#before_features(features) ⇒ Object



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

def before_features(features)
  print_profile_information
end

#before_outline_table(outline_table) ⇒ Object



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

def before_outline_table(outline_table)
  @outline_table = outline_table
end

#before_steps(*args) ⇒ Object



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

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

#exception(*args) ⇒ Object



63
64
65
# File 'lib/cucumber/formatter/progress.rb', line 63

def exception(*args)
  @exception_raised = true
end

#table_cell_value(value, status) ⇒ Object



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

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