simplecov 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -39,21 +39,37 @@ module SimpleCov
39
39
 
40
40
  # The overall percentual coverage for this result
41
41
  def covered_percent
42
- missed_lines, covered_lines = 0, 0
42
+ # Make sure that weird rounding error from #15, #23 and #24 does not occur again!
43
+ total_lines.zero? ? 0 : 100.0 * covered_lines / total_lines
44
+ end
45
+
46
+ # Returns the count of lines that are covered
47
+ def covered_lines
48
+ return @covered_lines if @covered_lines
49
+ @covered_lines = 0
43
50
  @files.each do |file|
44
51
  original_result[file.filename].each do |line_result|
45
- case line_result
46
- when 0
47
- missed_lines += 1
48
- when 1
49
- covered_lines += 1
50
- end
52
+ @covered_lines += 1 if line_result and line_result > 0
51
53
  end
52
54
  end
53
-
54
- total_lines = (missed_lines + covered_lines)
55
- # Make sure that weird rounding error from #15, #23 and #24 does not occur again!
56
- total_lines.zero? ? 0 : 100.0 * covered_lines / total_lines
55
+ @covered_lines
56
+ end
57
+
58
+ # Returns the count of missed lines
59
+ def missed_lines
60
+ return @missed_lines if @missed_lines
61
+ @missed_lines = 0
62
+ @files.each do |file|
63
+ original_result[file.filename].each do |line_result|
64
+ @missed_lines += 1 if line_result == 0
65
+ end
66
+ end
67
+ @missed_lines
68
+ end
69
+
70
+ # Total count of relevant lines (covered + missed)
71
+ def total_lines
72
+ @total_lines ||= (covered_lines + missed_lines)
57
73
  end
58
74
 
59
75
  # Applies the configured SimpleCov.formatter on this result
@@ -1,3 +1,3 @@
1
1
  module SimpleCov
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  end
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
14
14
 
15
15
  s.rubyforge_project = "simplecov"
16
16
 
17
- s.add_dependency 'simplecov-html', "~> 0.4.3"
17
+ s.add_dependency 'simplecov-html', "~> 0.4.4"
18
18
  s.add_development_dependency "shoulda", "2.10.3"
19
19
  s.add_development_dependency "rspec", "~> 2.0.0"
20
20
 
@@ -83,7 +83,7 @@ class TestMergeHelpers < Test::Unit::TestCase
83
83
 
84
84
  context "with second result way above the merge_timeout" do
85
85
  setup do
86
- @result2.created_at = Time.mktime(Time.now.year, Time.now.month, Time.now.day-2)
86
+ @result2.created_at = Time.now - 172800 # two days ago
87
87
  assert SimpleCov::ResultMerger.store_result(@result2)
88
88
  end
89
89
 
metadata CHANGED
@@ -1,12 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simplecov
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 4
8
- - 1
9
- version: 0.4.1
4
+ prerelease:
5
+ version: 0.4.2
10
6
  platform: ruby
11
7
  authors:
12
8
  - Christoph Olszowka
@@ -14,7 +10,7 @@ autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
12
 
17
- date: 2011-02-25 00:00:00 +01:00
13
+ date: 2011-04-02 00:00:00 +02:00
18
14
  default_executable:
19
15
  dependencies:
20
16
  - !ruby/object:Gem::Dependency
@@ -25,11 +21,7 @@ dependencies:
25
21
  requirements:
26
22
  - - ~>
27
23
  - !ruby/object:Gem::Version
28
- segments:
29
- - 0
30
- - 4
31
- - 3
32
- version: 0.4.3
24
+ version: 0.4.4
33
25
  type: :runtime
34
26
  version_requirements: *id001
35
27
  - !ruby/object:Gem::Dependency
@@ -40,10 +32,6 @@ dependencies:
40
32
  requirements:
41
33
  - - "="
42
34
  - !ruby/object:Gem::Version
43
- segments:
44
- - 2
45
- - 10
46
- - 3
47
35
  version: 2.10.3
48
36
  type: :development
49
37
  version_requirements: *id002
@@ -55,10 +43,6 @@ dependencies:
55
43
  requirements:
56
44
  - - ~>
57
45
  - !ruby/object:Gem::Version
58
- segments:
59
- - 2
60
- - 0
61
- - 0
62
46
  version: 2.0.0
63
47
  type: :development
64
48
  version_requirements: *id003
@@ -128,21 +112,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
128
112
  requirements:
129
113
  - - ">="
130
114
  - !ruby/object:Gem::Version
131
- segments:
132
- - 0
133
115
  version: "0"
134
116
  required_rubygems_version: !ruby/object:Gem::Requirement
135
117
  none: false
136
118
  requirements:
137
119
  - - ">="
138
120
  - !ruby/object:Gem::Version
139
- segments:
140
- - 0
141
121
  version: "0"
142
122
  requirements: []
143
123
 
144
124
  rubyforge_project: simplecov
145
- rubygems_version: 1.3.7
125
+ rubygems_version: 1.6.1
146
126
  signing_key:
147
127
  specification_version: 3
148
128
  summary: Code coverage for Ruby 1.9 with a powerful configuration library and automatic merging of coverage across test suites