class Cucumber::Formatter::SimpleDoc
Simple documentation formatter
Attributes
runtime[R]
Public Class Methods
new(runtime, path_or_io, options)
click to toggle source
# File lib/cucumber/formatter/simpledoc.rb, line 15 def initialize(runtime, path_or_io, options) @runtime = runtime @io = ensure_io(path_or_io) @options = options end
Public Instance Methods
after_background(_background)
click to toggle source
# File lib/cucumber/formatter/simpledoc.rb, line 45 def after_background(_background) @in_background = false end
after_features(features)
click to toggle source
# File lib/cucumber/formatter/simpledoc.rb, line 27 def after_features(features) print_summary(features) end
after_table_row(table_row)
click to toggle source
# File lib/cucumber/formatter/simpledoc.rb, line 75 def after_table_row(table_row) return unless table_row.exception @table_row = table_row @step = " Row: #{table_row.name}" exception(table_row.exception, table_row.status, 6) end
background_name(keyword, name, *_args)
click to toggle source
# File lib/cucumber/formatter/simpledoc.rb, line 49 def background_name(keyword, name, *_args) @background = " #{keyword}: #{name}" @io.puts @background @io.flush end
before_background(_background)
click to toggle source
# File lib/cucumber/formatter/simpledoc.rb, line 41 def before_background(_background) @in_background = true end
before_feature(_feature)
click to toggle source
# File lib/cucumber/formatter/simpledoc.rb, line 31 def before_feature(_feature) @background_failure = false end
before_features(_features)
click to toggle source
# File lib/cucumber/formatter/simpledoc.rb, line 21 def before_features(_features) print_profile_information @io.puts 'Testing has started...' @io.flush end
exception(exception, status, indent = 6)
click to toggle source
# File lib/cucumber/formatter/simpledoc.rb, line 65 def exception(exception, status, indent = 6) unless @background_failure print_scenario_summary print_exception(exception, status, indent) @io.puts @io.flush end @background_failure = @in_background end
feature_name(keyword, name)
click to toggle source
# File lib/cucumber/formatter/simpledoc.rb, line 35 def feature_name(keyword, name) @feature = "#{keyword}: #{name.split("\n")[0]}" @io.puts @feature @io.flush end
scenario_name(keyword, name, file_colon_line, _source_indent)
click to toggle source
# File lib/cucumber/formatter/simpledoc.rb, line 55 def scenario_name(keyword, name, file_colon_line, _source_indent) @scenario = " #{keyword}: #{name}" @io.puts @scenario.to_s.ljust(75) + yellow(" #{file_colon_line}") @io.flush end
step_name(keyword, step_match, *_args)
click to toggle source
# File lib/cucumber/formatter/simpledoc.rb, line 61 def step_name(keyword, step_match, *_args) @step = " #{keyword}#{step_match.format_args}" end
Private Instance Methods
print_scenario_summary()
click to toggle source
# File lib/cucumber/formatter/simpledoc.rb, line 84 def print_scenario_summary @io.puts @step unless @step.nil? @io.puts @table_row unless @table_row.nil? end
print_summary(features)
click to toggle source
# File lib/cucumber/formatter/simpledoc.rb, line 89 def print_summary(features) @io.puts print_stats(features, @options) print_snippets(@options) print_passing_wip(@options) end