class Cucumber::Core::Test::Result::Summary
=> 1
puts summary.total_passed
Result::Passed.new(0).describe_to(summary)
summary = Result::Summary.new
e.g.
An object that responds to the description protocol from the results and collects summary information.
def decrement_failed
def decrement_failed @totals[:failed] -= 1 end
def duration(duration)
def duration(duration) @durations << duration self end
def exception(exception)
def exception(exception) @exceptions << exception self end
def get_total(method_name)
def get_total(method_name) status = method_name.to_s.gsub('total_', '').to_sym @totals.fetch(status, 0) end
def increment_total(status)
def increment_total(status) @totals[status] += 1 self end
def initialize
def initialize @totals = Hash.new { 0 } @exceptions = [] @durations = [] end
def method_missing(name, *_args)
def method_missing(name, *_args) if name =~ /^total_/ get_total(name) else increment_total(name) end end
def ok?(strict: StrictConfiguration.new)
def ok?(strict: StrictConfiguration.new) TYPES.each do |type| if get_total(type) > 0 return false unless Result.ok?(type, strict: strict) end end true end
def respond_to_missing?(*)
def respond_to_missing?(*) true end
def total(for_status = nil)
def total(for_status = nil) if for_status @totals.fetch(for_status, 0) else @totals.values.reduce(0) { |total, count| total + count } end end