Class: Cucumber::Formatter::Progress
- Defined in:
- lib/cucumber/formatter/progress.rb
Overview
The formatter used for --format progress
Direct Known Subclasses
Constant Summary
Constants included from ANSIColor
Constants included from Term::ANSIColor
Term::ANSIColor::ATTRIBUTES, Term::ANSIColor::ATTRIBUTE_NAMES, Term::ANSIColor::COLORED_REGEXP
Instance Attribute Summary collapse
-
#runtime ⇒ Object
readonly
Returns the value of attribute runtime.
Instance Method Summary collapse
- #after_test_case(_test_case, result) ⇒ Object
- #after_test_step(test_step, result) ⇒ Object
- #before_test_case(_test_case) ⇒ Object
- #done ⇒ Object
-
#initialize(runtime, path_or_io, options) ⇒ Progress
constructor
A new instance of Progress.
Methods included from Io
ensure_dir, ensure_file, ensure_io
Methods included from Console
#collect_failing_scenarios, #collect_snippet_data, #embed, #empty_messages, #format_step, #format_string, #linebreaks, #print_elements, #print_exception, #print_failing_scenarios, #print_message, #print_messages, #print_passing_wip, #print_profile_information, #print_snippets, #print_statistics, #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
Constructor Details
#initialize(runtime, path_or_io, options) ⇒ Progress
Returns a new instance of Progress.
14 15 16 17 18 19 |
# File 'lib/cucumber/formatter/progress.rb', line 14 def initialize(runtime, path_or_io, ) @runtime, @io, @options = runtime, ensure_io(path_or_io), @previous_step_keyword = nil @snippets_input = [] @total_duration = 0 end |
Instance Attribute Details
#runtime ⇒ Object (readonly)
Returns the value of attribute runtime.
12 13 14 |
# File 'lib/cucumber/formatter/progress.rb', line 12 def runtime @runtime end |
Instance Method Details
#after_test_case(_test_case, result) ⇒ Object
34 35 36 |
# File 'lib/cucumber/formatter/progress.rb', line 34 def after_test_case(_test_case, result) @total_duration += DurationExtractor.new(result).result_duration end |
#after_test_step(test_step, result) ⇒ Object
29 30 31 32 |
# File 'lib/cucumber/formatter/progress.rb', line 29 def after_test_step(test_step, result) progress(result.to_sym) if !HookQueryVisitor.new(test_step).hook? || result.failed? collect_snippet_data(test_step, result) unless HookQueryVisitor.new(test_step).hook? end |
#before_test_case(_test_case) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/cucumber/formatter/progress.rb', line 21 def before_test_case(_test_case) unless @profile_information_printed print_profile_information @profile_information_printed = true end @previous_step_keyword = nil end |
#done ⇒ Object
38 39 40 41 42 |
# File 'lib/cucumber/formatter/progress.rb', line 38 def done @io.puts @io.puts print_summary end |