Class: Lemon::CoverReports::Abstract
- Inherits:
-
Object
- Object
- Lemon::CoverReports::Abstract
show all
- Defined in:
- lib/lemon/coverage/formats/abstract.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(coverage) ⇒ Abstract
Returns a new instance of Abstract.
7
8
9
|
# File 'lib/lemon/coverage/formats/abstract.rb', line 7
def initialize(coverage)
@coverage = coverage
end
|
Instance Attribute Details
#coverage ⇒ Object
Returns the value of attribute coverage.
12
13
14
|
# File 'lib/lemon/coverage/formats/abstract.rb', line 12
def coverage
@coverage
end
|
Instance Method Details
#covered_units ⇒ Object
18
19
20
|
# File 'lib/lemon/coverage/formats/abstract.rb', line 18
def covered_units
coverage.covered
end
|
#render ⇒ Object
15
16
|
# File 'lib/lemon/coverage/formats/abstract.rb', line 15
def render
end
|
#tally ⇒ Object
35
36
37
38
39
40
41
42
43
44
45
|
# File 'lib/lemon/coverage/formats/abstract.rb', line 35
def tally
c = covered_units.size
u = uncovered_units.size
t = c + u
pc = c * 100 / t
pu = u * 100 / t
"#{pc}% #{c}/#{t} covered, #{pu}% #{u}/#{t} uncovered" +
" (#{undefined_units.size} undefined units, #{uncovered_cases.size} uncovered cases)"
end
|
#uncovered_cases ⇒ Object
30
31
32
|
# File 'lib/lemon/coverage/formats/abstract.rb', line 30
def uncovered_cases
coverage.uncovered_cases
end
|
#uncovered_units ⇒ Object
22
23
24
|
# File 'lib/lemon/coverage/formats/abstract.rb', line 22
def uncovered_units
coverage.uncovered
end
|
#undefined_units ⇒ Object
26
27
28
|
# File 'lib/lemon/coverage/formats/abstract.rb', line 26
def undefined_units
coverage.undefined
end
|