Class: Inferno::ResultSummarizer

Inherits:
Object
  • Object
show all
Defined in:
lib/inferno/result_summarizer.rb

Overview

This class takes an array of results and determines the overall result. This is used to determine the result of a TestGroup/TestSuite based on the results of it’s children.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(results) ⇒ ResultSummarizer

Returns a new instance of ResultSummarizer.



10
11
12
# File 'lib/inferno/result_summarizer.rb', line 10

def initialize(results)
  @results = results.is_a?(ResultCollection) ? results : ResultCollection.new(results)
end

Instance Attribute Details

#resultsObject (readonly)

Returns the value of attribute results.



8
9
10
# File 'lib/inferno/result_summarizer.rb', line 8

def results
  @results
end

Instance Method Details

#summarizeObject



14
15
16
17
18
# File 'lib/inferno/result_summarizer.rb', line 14

def summarize
  return 'pass' if optional_results_passing_criteria_met?

  prioritized_result_strings.find { |result_string| unique_result_strings.include? result_string }
end