Skip to content

Commit

Permalink
move code to summarize and clean it
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaumik-Ashraf committed Jan 17, 2024
1 parent 4644b7e commit b17864c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/inferno/result_summarizer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ def initialize(results)
end

def summarize
return 'pass' if all_optional_results? &&
unique_result_strings.any?('pass') &&
unique_result_strings.none? { |result| %w[cancel wait running].include? result }

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

private

def prioritized_result_strings
if all_optional_results?
Entities::Result::RESULT_OPTIONS.slice(0, 3) + Entities::Result::RESULT_OPTIONS.slice(3, 8).reverse!.rotate!
else
Entities::Result::RESULT_OPTIONS
end
Entities::Result::RESULT_OPTIONS
end

def required_results
Expand Down

0 comments on commit b17864c

Please sign in to comment.