Class: Kapnismology::EvaluationCollection
- Inherits:
-
Object
- Object
- Kapnismology::EvaluationCollection
- Includes:
- Enumerable
- Defined in:
- lib/kapnismology/evaluation_collection.rb
Overview
A collection of the evaluations of the smoke tests
Instance Method Summary collapse
- #each(&_block) ⇒ Object
-
#initialize(test_classes) ⇒ EvaluationCollection
constructor
A new instance of EvaluationCollection.
- #passed? ⇒ Boolean
- #to_hash ⇒ Object
- #total_duration ⇒ Object
Constructor Details
#initialize(test_classes) ⇒ EvaluationCollection
Returns a new instance of EvaluationCollection.
8 9 10 |
# File 'lib/kapnismology/evaluation_collection.rb', line 8 def initialize(test_classes) @smoke_tests_classes = test_classes end |
Instance Method Details
#each(&_block) ⇒ Object
12 13 14 15 16 |
# File 'lib/kapnismology/evaluation_collection.rb', line 12 def each(&_block) evaluations.each do |member| yield(member) end end |
#passed? ⇒ Boolean
18 19 20 |
# File 'lib/kapnismology/evaluation_collection.rb', line 18 def passed? evaluations.all?(&:passed?) end |
#to_hash ⇒ Object
22 23 24 |
# File 'lib/kapnismology/evaluation_collection.rb', line 22 def to_hash evaluations.map(&:to_hash) end |
#total_duration ⇒ Object
26 27 28 |
# File 'lib/kapnismology/evaluation_collection.rb', line 26 def total_duration evaluations.inject(0) { |total, member| total += member.duration.to_i } end |