module Cucumber::Formatter::Summary

def dump_status_counts(find_elements_proc)

def dump_status_counts(find_elements_proc)
  counts = [:failed, :skipped, :undefined, :pending, :passed].map do |status|
    elements = find_elements_proc.call(status)
    elements.any? ? yield("#{elements.length} #{status.to_s}", status) : nil
  end.compact
  if counts.any?
    " (#{counts.join(', ')})"
  else
    ""
  end
end