simplecov 0.14.0 → 0.14.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/simplecov/source_file.rb +2 -2
- data/lib/simplecov/version.rb +1 -1
- data/spec/fixtures/never.rb +2 -0
- data/spec/fixtures/skipped.rb +4 -0
- data/spec/fixtures/skipped_and_executed.rb +8 -0
- data/spec/source_file_spec.rb +64 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bda7293a0b718da578a1e9b6897393d21d955fbf
|
4
|
+
data.tar.gz: d81ac2993a335e716a47a19dd648fe635cc4a635
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e25b2151aec02177f9a6dd1f14366d44ad1ab2158d8502c65bbf2db4e2672a1926eaba1107580f4a642ad99d79f57d421d54759bed341099ec4a1a4cb9a3a04
|
7
|
+
data.tar.gz: 34fe7bc261f7e105b230652e5b8ceed4e4b179bf7f36e5424c51cf7767e14ae91173a01b9da2e89707bd147ab212f85367e28791cfa1bbfcac3d055660e2ca43
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
0.14.1 2017-03-18 ([changes](https://github.com/colszowka/simplecov/compare/v0.14.0...v0.14.1))
|
2
|
+
========
|
3
|
+
|
4
|
+
## Bugfixes
|
5
|
+
|
6
|
+
* Files that were skipped as a whole/had no relevant coverage could lead to Float errors. See [#564](https://github.com/colszowka/simplecov/pull/564) (thanks to @stevehanson for the report in [#563](https://github.com/colszowka/simplecov/issues/563))
|
7
|
+
|
1
8
|
0.14.0 2017-03-15 ([changes](https://github.com/colszowka/simplecov/compare/v0.13.0...v0.14.0))
|
2
9
|
==========
|
3
10
|
|
@@ -125,13 +125,13 @@ module SimpleCov
|
|
125
125
|
end
|
126
126
|
|
127
127
|
def covered_strength
|
128
|
-
return 0.0 if
|
128
|
+
return 0.0 if relevant_lines.zero?
|
129
129
|
|
130
130
|
round_float(lines_strength / relevant_lines.to_f, 1)
|
131
131
|
end
|
132
132
|
|
133
133
|
def no_lines?
|
134
|
-
lines.length.zero? || lines.length == never_lines.size
|
134
|
+
lines.length.zero? || (lines.length == never_lines.size)
|
135
135
|
end
|
136
136
|
|
137
137
|
def lines_strength
|
data/lib/simplecov/version.rb
CHANGED
data/spec/source_file_spec.rb
CHANGED
@@ -73,5 +73,69 @@ if SimpleCov.usable?
|
|
73
73
|
expect(captured_output).to match(/^Warning: coverage data provided/)
|
74
74
|
end
|
75
75
|
end
|
76
|
+
|
77
|
+
context "a file that is never relevant" do
|
78
|
+
COVERAGE_FOR_NEVER_RB = [nil, nil].freeze
|
79
|
+
|
80
|
+
subject do
|
81
|
+
SimpleCov::SourceFile.new(source_fixture("never.rb"), COVERAGE_FOR_NEVER_RB)
|
82
|
+
end
|
83
|
+
|
84
|
+
it "has 0.0 covered_strength" do
|
85
|
+
expect(subject.covered_strength).to eq 0.0
|
86
|
+
end
|
87
|
+
|
88
|
+
it "has 0.0 covered_percent" do
|
89
|
+
expect(subject.covered_percent).to eq 100.0
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
context "a file where nothing is ever executed mixed with skipping #563" do
|
94
|
+
COVERAGE_FOR_SKIPPED_RB = [nil, nil, nil, nil].freeze
|
95
|
+
|
96
|
+
subject do
|
97
|
+
SimpleCov::SourceFile.new(source_fixture("skipped.rb"), COVERAGE_FOR_SKIPPED_RB)
|
98
|
+
end
|
99
|
+
|
100
|
+
it "has 0.0 covered_strength" do
|
101
|
+
expect(subject.covered_strength).to eq 0.0
|
102
|
+
end
|
103
|
+
|
104
|
+
it "has 0.0 covered_percent" do
|
105
|
+
expect(subject.covered_percent).to eq 0.0
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
context "a file where everything is skipped and missed #563" do
|
110
|
+
COVERAGE_FOR_SKIPPED_RB_2 = [nil, nil, 0, nil].freeze
|
111
|
+
|
112
|
+
subject do
|
113
|
+
SimpleCov::SourceFile.new(source_fixture("skipped.rb"), COVERAGE_FOR_SKIPPED_RB_2)
|
114
|
+
end
|
115
|
+
|
116
|
+
it "has 0.0 covered_strength" do
|
117
|
+
expect(subject.covered_strength).to eq 0.0
|
118
|
+
end
|
119
|
+
|
120
|
+
it "has 0.0 covered_percent" do
|
121
|
+
expect(subject.covered_percent).to eq 0.0
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
context "a file where everything is skipped/irrelevamt but executed #563" do
|
126
|
+
COVERAGE_FOR_SKIPPED_AND_EXECUTED_RB = [nil, nil, 1, 1, 0, nil, nil, nil].freeze
|
127
|
+
|
128
|
+
subject do
|
129
|
+
SimpleCov::SourceFile.new(source_fixture("skipped_and_executed.rb"), COVERAGE_FOR_SKIPPED_AND_EXECUTED_RB)
|
130
|
+
end
|
131
|
+
|
132
|
+
it "has 0.0 covered_strength" do
|
133
|
+
expect(subject.covered_strength).to eq 0.0
|
134
|
+
end
|
135
|
+
|
136
|
+
it "has 0.0 covered_percent" do
|
137
|
+
expect(subject.covered_percent).to eq 0.0
|
138
|
+
end
|
139
|
+
end
|
76
140
|
end
|
77
141
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simplecov
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.14.
|
4
|
+
version: 0.14.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christoph Olszowka
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -187,9 +187,12 @@ files:
|
|
187
187
|
- spec/fixtures/frameworks/testunit_bad.rb
|
188
188
|
- spec/fixtures/frameworks/testunit_good.rb
|
189
189
|
- spec/fixtures/iso-8859.rb
|
190
|
+
- spec/fixtures/never.rb
|
190
191
|
- spec/fixtures/resultset1.rb
|
191
192
|
- spec/fixtures/resultset2.rb
|
192
193
|
- spec/fixtures/sample.rb
|
194
|
+
- spec/fixtures/skipped.rb
|
195
|
+
- spec/fixtures/skipped_and_executed.rb
|
193
196
|
- spec/fixtures/utf-8.rb
|
194
197
|
- spec/helper.rb
|
195
198
|
- spec/last_run_spec.rb
|