Class: Specdown::ReportSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/specdown/readme/report_summary.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#readmesObject (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

#exceptionsObject



33
34
35
# File 'lib/specdown/readme/report_summary.rb', line 33

def exceptions
  @exceptions ||= @readmes.map(&:tests).flatten.map(&:exception).compact
end

#num_failingObject



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_markdownsObject



9
10
11
# File 'lib/specdown/readme/report_summary.rb', line 9

def num_markdowns
  @num_markdowns ||= @readmes.count
end

#num_passingObject



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_pendingObject



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_testsObject



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_undefinedObject



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