Class: Specdown::ReportSummary
- Inherits:
-
Object
- Object
- Specdown::ReportSummary
- Defined in:
- lib/specdown/readme/report_summary.rb
Instance Attribute Summary collapse
-
#readmes ⇒ Object
readonly
Returns the value of attribute readmes.
Instance Method Summary collapse
- #exceptions ⇒ Object
-
#initialize(readmes) ⇒ ReportSummary
constructor
A new instance of ReportSummary.
- #num_failing ⇒ Object
- #num_markdowns ⇒ Object
- #num_passing ⇒ Object
- #num_pending ⇒ Object
- #num_tests ⇒ Object
- #num_undefined ⇒ Object
Constructor Details
#initialize(readmes) ⇒ ReportSummary
Returns a new instance of ReportSummary.
5 6 7 |
# File 'lib/specdown/readme/report_summary.rb', line 5 def initialize(readmes) @readmes = readmes.respond_to?(:map) ? readmes : [readmes] end |
Instance Attribute Details
#readmes ⇒ Object (readonly)
Returns the value of attribute readmes.
3 4 5 |
# File 'lib/specdown/readme/report_summary.rb', line 3 def readmes @readmes end |
Instance Method Details
#exceptions ⇒ Object
33 34 35 |
# File 'lib/specdown/readme/report_summary.rb', line 33 def exceptions @exceptions ||= @readmes.map(&:tests).flatten.map(&:exception).compact end |
#num_failing ⇒ Object
25 26 27 |
# File 'lib/specdown/readme/report_summary.rb', line 25 def num_failing @num_failing ||= @readmes.map(&:stats).map(&:num_failing).inject(0, &:+) end |
#num_markdowns ⇒ Object
9 10 11 |
# File 'lib/specdown/readme/report_summary.rb', line 9 def num_markdowns @num_markdowns ||= @readmes.count end |
#num_passing ⇒ Object
29 30 31 |
# File 'lib/specdown/readme/report_summary.rb', line 29 def num_passing @num_passing ||= @readmes.map(&:stats).map(&:num_passing).inject(0, &:+) end |
#num_pending ⇒ Object
17 18 19 |
# File 'lib/specdown/readme/report_summary.rb', line 17 def num_pending @num_pending ||= @readmes.map(&:stats).map(&:num_pending).inject(0, &:+) end |
#num_tests ⇒ Object
13 14 15 |
# File 'lib/specdown/readme/report_summary.rb', line 13 def num_tests @num_tests ||= @readmes.map(&:stats).map(&:num_tests).inject(0, &:+) end |
#num_undefined ⇒ Object
21 22 23 |
# File 'lib/specdown/readme/report_summary.rb', line 21 def num_undefined @num_undefined ||= @readmes.map(&:stats).map(&:num_undefined).inject(0, &:+) end |