Class: Rutema::ReportState
- Inherits:
-
Object
- Object
- Rutema::ReportState
- Defined in:
- lib/rutema/core/framework.rb
Overview
While executing tests the state of each test is collected in an instance of ReportState and the collection is at the end passed to the available block reporters
ReportState assumes the timestamp of the first message, the status of the last message and accumulates the duration reported by all messages in it's collection.
Instance Attribute Summary collapse
-
#duration ⇒ Object
readonly
Returns the value of attribute duration.
-
#is_special ⇒ Object
readonly
Returns the value of attribute is_special.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#steps ⇒ Object
Returns the value of attribute steps.
-
#test ⇒ Object
readonly
Returns the value of attribute test.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Instance Method Summary collapse
- #<<(message) ⇒ Object
-
#initialize(message) ⇒ ReportState
constructor
A new instance of ReportState.
Constructor Details
#initialize(message) ⇒ ReportState
Returns a new instance of ReportState.
128 129 130 131 132 133 134 135 |
# File 'lib/rutema/core/framework.rb', line 128 def initialize() @test = .test = . @duration = .duration @status = .status @steps = [] @is_special = .is_special end |
Instance Attribute Details
#duration ⇒ Object (readonly)
Returns the value of attribute duration.
126 127 128 |
# File 'lib/rutema/core/framework.rb', line 126 def duration @duration end |
#is_special ⇒ Object (readonly)
Returns the value of attribute is_special.
126 127 128 |
# File 'lib/rutema/core/framework.rb', line 126 def is_special @is_special end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
126 127 128 |
# File 'lib/rutema/core/framework.rb', line 126 def status @status end |
#steps ⇒ Object
Returns the value of attribute steps.
125 126 127 |
# File 'lib/rutema/core/framework.rb', line 125 def steps @steps end |
#test ⇒ Object (readonly)
Returns the value of attribute test.
126 127 128 |
# File 'lib/rutema/core/framework.rb', line 126 def test @test end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
126 127 128 |
# File 'lib/rutema/core/framework.rb', line 126 def end |
Instance Method Details
#<<(message) ⇒ Object
137 138 139 140 141 142 |
# File 'lib/rutema/core/framework.rb', line 137 def <<() @steps << @duration += .duration @status = .status unless .status.nil? \ || (!@status.nil? && STATUS_CODES.find_index(.status) < STATUS_CODES.find_index(@status)) end |