class Cucumber::Core::Test::Result::Summary
=> 1
puts summary.total_passed
Result::Passed.new(0).describe_to(summary)
summary = Result::Summary.new
e.g.
and collects summary information.
An object that responds to the description protocol from the results
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 return @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?(be_strict = StrictConfiguration.new)
def ok?(be_strict = StrictConfiguration.new) TYPES.each do |type| if get_total(type) > 0 return false unless Result.ok?(type, be_strict) end end true end
def total(for_status = nil)
def total(for_status = nil) if for_status @totals.fetch(for_status, 0) else @totals.reduce(0) { |total, status| total += status[1] } end end