simplecov 0.15.0 → 0.15.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/CHANGELOG.md +9 -1
- data/README.md +1 -2
- data/Rakefile +0 -2
- data/doc/alternate-formatters.md +6 -1
- data/lib/simplecov/defaults.rb +2 -2
- data/lib/simplecov/version.rb +1 -1
- data/spec/defaults_spec.rb +41 -0
- data/spec/filters_spec.rb +30 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8f001c1d4f9343c21eee5371b68f31a56caf35b752a08a662115418176a6156
|
4
|
+
data.tar.gz: 519eaaee340436685bc0c31a61d9fc1356072e1d39d573bce8049afe79332252
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94a6c0d8f0245befdf662d339bae1b2e0d4a077d3591764f9c215f06453f9e86a40127d3fe5f7488875c470caf8743d19307352e72eaff6f5dfc2c657a828622
|
7
|
+
data.tar.gz: eb674773b777504acba00508c7cc62f2e0f1451fb26d1a06463a822130e2cceeda4a8aba964569579becd62b7951f5968dbdd351549143cc81a69e1628923cad
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
0.15.1 (2017-09-11) ([changes](https://github.com/colszowka/simplecov/compare/v0.15.0...v0.15.1))
|
2
|
+
=======
|
3
|
+
|
4
|
+
## Bugfixes
|
5
|
+
|
6
|
+
* Filter directories outside SimpleCov.root that have it as a prefix. See [#617](https://github.com/colszowka/simplecov/pull/617) (thanks @jenseng)
|
7
|
+
* Fix standard rails profile rails filter (didn't work). See [#618](https://github.com/colszowka/simplecov/pull/618) (thanks @jenseng again!)
|
8
|
+
|
1
9
|
0.15.0 (2017-08-14) ([changes](https://github.com/colszowka/simplecov/compare/v0.14.1...v0.15.0))
|
2
10
|
=======
|
3
11
|
|
@@ -271,7 +279,7 @@ has been added.
|
|
271
279
|
* Average hits per line for groups of files is now computed correctly.
|
272
280
|
See [#192](http://github.com/colszowka/simplecov/pull/192) and
|
273
281
|
[#179](http://github.com/colszowka/simplecov/issues/179) (thanks to @graysonwright)
|
274
|
-
*
|
282
|
+
* Compatibility with BINARY internal encoding.
|
275
283
|
See [#194](https://github.com/colszowka/simplecov/pull/194) and
|
276
284
|
[#127](https://github.com/colszowka/simplecov/issues/127) (thanks to @justfalter)
|
277
285
|
* Special characters in `SimpleCov.root` are now correctly escaped before being used as a RegExp.
|
data/README.md
CHANGED
@@ -349,8 +349,7 @@ end
|
|
349
349
|
# :nocov:
|
350
350
|
```
|
351
351
|
|
352
|
-
The name of the token can be changed to your liking. [Learn more about the nocov feature.]
|
353
|
-
[nocov]: https://github.com/colszowka/simplecov/blob/master/features/config_nocov_token.feature
|
352
|
+
The name of the token can be changed to your liking. [Learn more about the nocov feature.]( https://github.com/colszowka/simplecov/blob/master/features/config_nocov_token.feature)
|
354
353
|
|
355
354
|
**Note:** You shouldn't have to use the nocov token to skip private methods that are being included in your coverage. If you appropriately test the public interface of your classes and objects you should automatically get full coverage of your private methods.
|
356
355
|
|
data/Rakefile
CHANGED
data/doc/alternate-formatters.md
CHANGED
@@ -33,4 +33,9 @@ JSON formatter for SimpleCov
|
|
33
33
|
#### [simplecov-single_file_reporter](https://github.com/grosser/simplecov-single_file_reporter)
|
34
34
|
*by [Michael Grosser](http://grosser.it)*
|
35
35
|
|
36
|
-
A formatter that prints the coverage of the file under test when you run a single test file.
|
36
|
+
A formatter that prints the coverage of the file under test when you run a single test file.
|
37
|
+
|
38
|
+
#### [simplecov-t_wada](https://github.com/ysksn/simplecov-t_wada)
|
39
|
+
*by [Yosuke Kabuto](https://github.com/ysksn)*
|
40
|
+
|
41
|
+
t_wada AA formatter for SimpleCov
|
data/lib/simplecov/defaults.rb
CHANGED
@@ -6,7 +6,7 @@ SimpleCov.profiles.define "root_filter" do
|
|
6
6
|
# Exclude all files outside of simplecov root
|
7
7
|
root_filter = nil
|
8
8
|
add_filter do |src|
|
9
|
-
root_filter ||= /\A#{Regexp.escape(SimpleCov.root)}/io
|
9
|
+
root_filter ||= /\A#{Regexp.escape(SimpleCov.root + File::SEPARATOR)}/io
|
10
10
|
src.filename !~ root_filter
|
11
11
|
end
|
12
12
|
end
|
@@ -26,7 +26,7 @@ SimpleCov.profiles.define "rails" do
|
|
26
26
|
load_profile "test_frameworks"
|
27
27
|
|
28
28
|
add_filter %r{^/config/}
|
29
|
-
add_filter %r{
|
29
|
+
add_filter %r{^/db/}
|
30
30
|
|
31
31
|
add_group "Controllers", "app/controllers"
|
32
32
|
add_group "Channels", "app/channels" if defined?(ActionCable)
|
data/lib/simplecov/version.rb
CHANGED
@@ -0,0 +1,41 @@
|
|
1
|
+
require "helper"
|
2
|
+
|
3
|
+
if SimpleCov.usable?
|
4
|
+
describe SimpleCov do
|
5
|
+
skip "requires the default configuration" if ENV["SIMPLECOV_NO_DEFAULTS"]
|
6
|
+
|
7
|
+
context "profiles" do
|
8
|
+
let(:config_class) do
|
9
|
+
Class.new do
|
10
|
+
include SimpleCov::Configuration
|
11
|
+
|
12
|
+
def load_profile(name)
|
13
|
+
configure(&SimpleCov.profiles[name.to_sym])
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
let(:config) { config_class.new }
|
19
|
+
|
20
|
+
def filtered?(config, filename)
|
21
|
+
path = File.join(SimpleCov.root, filename)
|
22
|
+
file = SimpleCov::SourceFile.new(path, [nil, 1, 1, 1, nil, nil, 1, 0, nil, nil])
|
23
|
+
config.filters.any? { |filter| filter.matches?(file) }
|
24
|
+
end
|
25
|
+
|
26
|
+
it "provides a sensible test_frameworks profile" do
|
27
|
+
config.load_profile(:test_frameworks)
|
28
|
+
expect(filtered?(config, "foo.rb")).not_to be
|
29
|
+
expect(filtered?(config, "test/foo.rb")).to be
|
30
|
+
expect(filtered?(config, "spec/bar.rb")).to be
|
31
|
+
end
|
32
|
+
|
33
|
+
it "provides a sensible rails profile" do
|
34
|
+
config.load_profile(:rails)
|
35
|
+
expect(filtered?(config, "app/models/user.rb")).not_to be
|
36
|
+
expect(filtered?(config, "db/schema.rb")).to be
|
37
|
+
expect(filtered?(config, "config/environment.rb")).to be
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
data/spec/filters_spec.rb
CHANGED
@@ -155,6 +155,36 @@ if SimpleCov.usable?
|
|
155
155
|
end
|
156
156
|
end
|
157
157
|
|
158
|
+
context "with the default configuration" do
|
159
|
+
skip "requires the default configuration" if ENV["SIMPLECOV_NO_DEFAULTS"]
|
160
|
+
|
161
|
+
def a_file(path)
|
162
|
+
path = File.join(SimpleCov.root, path) unless path.start_with?("/")
|
163
|
+
SimpleCov::SourceFile.new(path, [nil, 1, 1, 1, nil, nil, 1, 0, nil, nil])
|
164
|
+
end
|
165
|
+
|
166
|
+
context "inside the project" do
|
167
|
+
it "doesn't filter" do
|
168
|
+
expect(SimpleCov.filtered([a_file("foo.rb")]).count).to eq(1)
|
169
|
+
end
|
170
|
+
|
171
|
+
it "filters vendor/bundle" do
|
172
|
+
expect(SimpleCov.filtered([a_file("vendor/bundle/foo.rb")]).count).to eq(0)
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
176
|
+
context "outside the project" do
|
177
|
+
it "filters" do
|
178
|
+
expect(SimpleCov.filtered([a_file("/other/path/foo.rb")]).count).to eq(0)
|
179
|
+
end
|
180
|
+
|
181
|
+
it "filters even if the sibling directory has SimpleCov.root as a prefix" do
|
182
|
+
sibling_dir = SimpleCov.root + "_cache"
|
183
|
+
expect(SimpleCov.filtered([a_file(sibling_dir + "/foo.rb")]).count).to eq(0)
|
184
|
+
end
|
185
|
+
end
|
186
|
+
end
|
187
|
+
|
158
188
|
describe ".class_for_argument" do
|
159
189
|
it "returns SimpleCov::StringFilter for a string" do
|
160
190
|
expect(SimpleCov::Filter.class_for_argument("filestring")).to eq(SimpleCov::StringFilter)
|
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.15.
|
4
|
+
version: 0.15.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-
|
11
|
+
date: 2017-09-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -159,6 +159,7 @@ files:
|
|
159
159
|
- spec/command_guesser_spec.rb
|
160
160
|
- spec/config_loader_spec.rb
|
161
161
|
- spec/configuration_spec.rb
|
162
|
+
- spec/defaults_spec.rb
|
162
163
|
- spec/deleted_source_spec.rb
|
163
164
|
- spec/faked_project/Gemfile
|
164
165
|
- spec/faked_project/Rakefile
|