class Kapnismology::EvaluationCollection

A collection of the evaluations of the smoke tests

Public Class Methods

new(test_classes) click to toggle source
# File lib/kapnismology/evaluation_collection.rb, line 8
def initialize(test_classes)
  @smoke_tests_classes = test_classes
end

Public Instance Methods

each(&_block) click to toggle source
# File lib/kapnismology/evaluation_collection.rb, line 12
def each(&_block)
  evaluations.each(&_block)
end
passed?() click to toggle source
# File lib/kapnismology/evaluation_collection.rb, line 16
def passed?
  evaluations.all?(&:passed?)
end
to_hash() click to toggle source
# File lib/kapnismology/evaluation_collection.rb, line 20
def to_hash
  evaluations.map(&:to_hash)
end
total_duration() click to toggle source
# File lib/kapnismology/evaluation_collection.rb, line 24
def total_duration
  evaluations.inject(0) { |total, member| total += member.duration.to_i }
end

Private Instance Methods

evaluations() click to toggle source
# File lib/kapnismology/evaluation_collection.rb, line 30
def evaluations
  @evaluations ||= @smoke_tests_classes.each_with_object([]) do |klass, memo|
    evaluation = Evaluation.new(klass)
    memo << evaluation unless evaluation.result.class.ancestors.include?(Kapnismology::NotApplicableResult)
  end
end