Class: Kapnismology::Result
- Inherits:
-
BaseResult
- Object
- BaseResult
- Kapnismology::Result
- Defined in:
- lib/kapnismology/result.rb
Overview
This is the result of each smoke test. This class makes sense to enforce smoke test to return something known Params of the constructor:
-
passed : Boolean: true -> test passed, false -> test failed
-
data : Hash representing the result of the test
-
message: String with an extra message to provide human readable information
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from BaseResult
#data, #debug_messages, #duration, #message
Instance Method Summary collapse
-
#initialize(passed, data, message) ⇒ Result
constructor
A new instance of Result.
Methods inherited from BaseResult
#add_debug_messages, #passed?, #record_duration, #to_hash, #to_s
Constructor Details
#initialize(passed, data, message) ⇒ Result
Returns a new instance of Result.
59 60 61 62 63 64 65 66 67 68 |
# File 'lib/kapnismology/result.rb', line 59 def initialize(passed, data, ) raise ArgumentError, 'passed argument must be true or false' unless !!passed == passed raise ArgumentError, 'data argument must be a hash' unless data.is_a?(Hash) @passed = passed @data = data @message = @debug_messages = [] @duration = 0 end |