Class: Strut::ScenarioResult
- Inherits:
-
Object
- Object
- Strut::ScenarioResult
- Defined in:
- lib/strut/scenario_result.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#name ⇒ Object
Returns the value of attribute name.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
-
#time ⇒ Object
Returns the value of attribute time.
Instance Method Summary collapse
- #add_annotation_for_line(line, type, message = "") ⇒ Object
- #add_exception_for_line(line, message) ⇒ Object
- #add_fail_for_line(line, message) ⇒ Object
- #add_ok_for_line(line) ⇒ Object
- #annotations_for_line(line) ⇒ Object
-
#initialize ⇒ ScenarioResult
constructor
A new instance of ScenarioResult.
Constructor Details
#initialize ⇒ ScenarioResult
Returns a new instance of ScenarioResult.
12 13 14 15 |
# File 'lib/strut/scenario_result.rb', line 12 def initialize @annotations = Hash.new { |h, k| h[k] = [] } @time = 0.0 end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
10 11 12 |
# File 'lib/strut/scenario_result.rb', line 10 def end |
#name ⇒ Object
Returns the value of attribute name.
9 10 11 |
# File 'lib/strut/scenario_result.rb', line 9 def name @name end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
10 11 12 |
# File 'lib/strut/scenario_result.rb', line 10 def result @result end |
#time ⇒ Object
Returns the value of attribute time.
9 10 11 |
# File 'lib/strut/scenario_result.rb', line 9 def time @time end |
Instance Method Details
#add_annotation_for_line(line, type, message = "") ⇒ Object
29 30 31 |
# File 'lib/strut/scenario_result.rb', line 29 def add_annotation_for_line(line, type, = "") @annotations[line] << Annotation.new(type, ) end |
#add_exception_for_line(line, message) ⇒ Object
25 26 27 |
# File 'lib/strut/scenario_result.rb', line 25 def add_exception_for_line(line, ) add_annotation_for_line(line, ANNOTATION_EXCEPTION, ) end |
#add_fail_for_line(line, message) ⇒ Object
21 22 23 |
# File 'lib/strut/scenario_result.rb', line 21 def add_fail_for_line(line, ) add_annotation_for_line(line, ANNOTATION_FAIL, ) end |
#add_ok_for_line(line) ⇒ Object
17 18 19 |
# File 'lib/strut/scenario_result.rb', line 17 def add_ok_for_line(line) add_annotation_for_line(line, ANNOTATION_OK) end |
#annotations_for_line(line) ⇒ Object
33 34 35 |
# File 'lib/strut/scenario_result.rb', line 33 def annotations_for_line(line) @annotations[line] end |