Class: Strut::Report

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeReport



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

def initialize
  @scenario_results = []
  @errors = []
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



6
7
8
# File 'lib/strut/report.rb', line 6

def errors
  @errors
end

#number_failedObject (readonly)

Returns the value of attribute number_failed.



5
6
7
# File 'lib/strut/report.rb', line 5

def number_failed
  @number_failed
end

#number_passedObject (readonly)

Returns the value of attribute number_passed.



5
6
7
# File 'lib/strut/report.rb', line 5

def number_passed
  @number_passed
end

#number_scenariosObject (readonly)

Returns the value of attribute number_scenarios.



5
6
7
# File 'lib/strut/report.rb', line 5

def number_scenarios
  @number_scenarios
end

#number_skippedObject (readonly)

Returns the value of attribute number_skipped.



5
6
7
# File 'lib/strut/report.rb', line 5

def number_skipped
  @number_skipped
end

#scenario_resultsObject (readonly)

Returns the value of attribute scenario_results.



6
7
8
# File 'lib/strut/report.rb', line 6

def scenario_results
  @scenario_results
end

Instance Method Details

#add_error(error) ⇒ Object



17
18
19
# File 'lib/strut/report.rb', line 17

def add_error(error)
  @errors << error
end

#add_scenario_result(result) ⇒ Object



13
14
15
# File 'lib/strut/report.rb', line 13

def add_scenario_result(result)
  @scenario_results << result
end

#annotations_for_line(line) ⇒ Object



21
22
23
24
25
26
# File 'lib/strut/report.rb', line 21

def annotations_for_line(line)
  all_annotations = @scenario_results.map do |result|
    result.annotations_for_line(line)
  end
  all_annotations.reject { |a| a.empty? }.flatten
end

#number_with_result(result) ⇒ Object



44
45
46
# File 'lib/strut/report.rb', line 44

def number_with_result(result)
  @scenario_results.select { |scenario| scenario.result == result }.count
end