Sha256: d843e737765b502cd4cc7f37607fc63145a72b6939459e786704d2d6923abc03
Contents?: true
Size: 496 Bytes
Versions: 38
Compression:
Stored size: 496 Bytes
Contents
class Stats include ActiveModel::Model attr_accessor :passed, :passed_with_warnings, :failed, :pending, :skipped def submitted passed + passed_with_warnings + failed end def done? failed + pending == 0 end def started? submitted > 0 end def self.from_statuses(statuses) Stats.new(statuses.inject({passed: 0, passed_with_warnings: 0, failed: 0, pending: 0, skipped: 0}) do |accum, status| accum[status.group.to_sym] += 1 accum end) end end
Version data entries
38 entries across 38 versions & 2 rubygems