Class: Belajar::TestExample
- Inherits:
-
Object
- Object
- Belajar::TestExample
- Defined in:
- lib/belajar/test_result.rb
Constant Summary collapse
- PASSED =
'passed'.freeze
- FAILED =
'failed'.freeze
- EXAMPLE_PASSED_MESSAGE =
'Your code passed this requirement.'.freeze
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(status:, description: nil, message: nil) ⇒ TestExample
constructor
A new instance of TestExample.
- #passed? ⇒ Boolean
Constructor Details
#initialize(status:, description: nil, message: nil) ⇒ TestExample
Returns a new instance of TestExample.
109 110 111 112 113 |
# File 'lib/belajar/test_result.rb', line 109 def initialize(status:, description: nil, message: nil) @description = description @status = status @message = || EXAMPLE_PASSED_MESSAGE end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
105 106 107 |
# File 'lib/belajar/test_result.rb', line 105 def description @description end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
105 106 107 |
# File 'lib/belajar/test_result.rb', line 105 def @message end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
105 106 107 |
# File 'lib/belajar/test_result.rb', line 105 def status @status end |
Instance Method Details
#passed? ⇒ Boolean
115 116 117 |
# File 'lib/belajar/test_result.rb', line 115 def passed? @status == PASSED end |