Class: Polytrix::Result

Inherits:
Hashie::Dash
  • Object
show all
Extended by:
Forwardable
Includes:
Hashie::Extensions::Coercion
Defined in:
lib/polytrix/result.rb

Instance Method Summary collapse

Instance Method Details

#statusObject



16
17
18
19
20
21
22
23
# File 'lib/polytrix/result.rb', line 16

def status
  # A feature can be validated by different suites, or manually vs an automated suite.
  # That's why there's a precedence rather than boolean algebra here...
  return 'failed' if validations.values.any? { |v| v.result == 'failed' }
  return 'passed' if validations.values.any? { |v| v.result == 'passed' }
  return 'pending' if validations.values.any? { |v| v.result == 'pending' }
  'skipped'
end