Class: Strut::Report
- Inherits:
-
Object
- Object
- Strut::Report
- Defined in:
- lib/strut/report.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#number_failed ⇒ Object
readonly
Returns the value of attribute number_failed.
-
#number_passed ⇒ Object
readonly
Returns the value of attribute number_passed.
-
#number_scenarios ⇒ Object
readonly
Returns the value of attribute number_scenarios.
-
#number_skipped ⇒ Object
readonly
Returns the value of attribute number_skipped.
-
#scenario_results ⇒ Object
readonly
Returns the value of attribute scenario_results.
Instance Method Summary collapse
- #add_error(error) ⇒ Object
- #add_scenario_result(result) ⇒ Object
- #annotations_for_line(line) ⇒ Object
-
#initialize ⇒ Report
constructor
A new instance of Report.
- #number_with_result(result) ⇒ Object
Constructor Details
#initialize ⇒ Report
8 9 10 11 |
# File 'lib/strut/report.rb', line 8 def initialize @scenario_results = [] @errors = [] end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
6 7 8 |
# File 'lib/strut/report.rb', line 6 def errors @errors end |
#number_failed ⇒ Object (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_passed ⇒ Object (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_scenarios ⇒ Object (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_skipped ⇒ Object (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_results ⇒ Object (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 |