Class: Strut::ScenarioResult

Inherits:
Object
  • Object
show all
Defined in:
lib/strut/scenario_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeScenarioResult

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

#messageObject (readonly)

Returns the value of attribute message.



10
11
12
# File 'lib/strut/scenario_result.rb', line 10

def message
  @message
end

#nameObject

Returns the value of attribute name.



9
10
11
# File 'lib/strut/scenario_result.rb', line 9

def name
  @name
end

#resultObject (readonly)

Returns the value of attribute result.



10
11
12
# File 'lib/strut/scenario_result.rb', line 10

def result
  @result
end

#timeObject

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, message = "")
  @annotations[line] << Annotation.new(type, message)
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, message)
  add_annotation_for_line(line, ANNOTATION_EXCEPTION, message)
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, message)
  add_annotation_for_line(line, ANNOTATION_FAIL, message)
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