Class: Mumukit::Metatest::TestResultBuilder
- Inherits:
-
Object
- Object
- Mumukit::Metatest::TestResultBuilder
- Defined in:
- lib/mumukit/metatest/test_result_builder.rb
Instance Attribute Summary collapse
-
#result ⇒ Object
Returns the value of attribute result.
-
#status ⇒ Object
Returns the value of attribute status.
-
#summary_message ⇒ Object
Returns the value of attribute summary_message.
-
#summary_type ⇒ Object
Returns the value of attribute summary_type.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
Instance Attribute Details
#result ⇒ Object
Returns the value of attribute result.
3 4 5 |
# File 'lib/mumukit/metatest/test_result_builder.rb', line 3 def result @result end |
#status ⇒ Object
Returns the value of attribute status.
3 4 5 |
# File 'lib/mumukit/metatest/test_result_builder.rb', line 3 def status @status end |
#summary_message ⇒ Object
Returns the value of attribute summary_message.
3 4 5 |
# File 'lib/mumukit/metatest/test_result_builder.rb', line 3 def @summary_message end |
#summary_type ⇒ Object
Returns the value of attribute summary_type.
3 4 5 |
# File 'lib/mumukit/metatest/test_result_builder.rb', line 3 def summary_type @summary_type end |
#title ⇒ Object
Returns the value of attribute title.
3 4 5 |
# File 'lib/mumukit/metatest/test_result_builder.rb', line 3 def title @title end |
Instance Method Details
#build ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/mumukit/metatest/test_result_builder.rb', line 9 def build raise 'missing status' unless status raise "invalid #{status}" unless status.passed? || status.failed? if .present? || summary_type.present? [title, status, result, summary] else [title, status, result] end end |
#summary ⇒ Object
5 6 7 |
# File 'lib/mumukit/metatest/test_result_builder.rb', line 5 def summary {type: summary_type.presence, message: .presence}.compact end |