Name | Total Lines | Lines of Code | Total Coverage | Code Coverage |
---|---|---|---|---|
lib/jldrill/model/Quiz/Timer.rb | 35 | 29 | 100.00%
|
100.00%
|
Code reported as executed by Ruby looks like this...and this: this line is also marked as covered.Lines considered as run by rcov, but not reported by Ruby, look like this,and this: these lines were inferred by rcov (using simple heuristics).Finally, here's a line marked as not executed.
1 module JLDrill |
2 class Timer |
3 attr_reader :total, :startedAt |
4 |
5 def initialize |
6 reset |
7 end |
8 |
9 def reset |
10 @total = 0.0 |
11 @startedAt = nil |
12 end |
13 |
14 def assign(timer) |
15 @total = timer.total |
16 @startedAt = timer.startedAt |
17 end |
18 |
19 def start |
20 stop |
21 @startedAt = Time.now |
22 end |
23 |
24 def running? |
25 !@startedAt.nil? |
26 end |
27 |
28 def stop |
29 if running? |
30 @total += Time.now.to_f - @startedAt.to_f |
31 @startedAt = nil |
32 end |
33 end |
34 end |
35 end |
Generated on Mon May 23 16:17:46 +0900 2011 with rcov 0.9.8