puppetlabs_spec_helper 7.0.1 → 7.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/README.md +1 -1
- data/lib/puppetlabs_spec_helper/module_spec_helper.rb +30 -23
- data/lib/puppetlabs_spec_helper/rake_tasks.rb +1 -1
- data/lib/puppetlabs_spec_helper/version.rb +1 -1
- data/spec/spec_helper.rb +15 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 366ee96dda8718a2f1a5109f22199498a45537018293d8244c6a1c99100f05d7
|
4
|
+
data.tar.gz: 2ab0a7f32449c1e09314ac6fc42bab529c6bb21a6f7b60c023834755f8f96e5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c284322ddaacbb89fef507ad1c192b0eeb07366c93a8a5e09a30b74cf7ac4f10e8d06cac537af4d3c1e2f045071b014486b61c7191a185e11a77fbb11e30b307
|
7
|
+
data.tar.gz: b3db215e3d920e4edcfa4562854bbe8619ee7fd74efb72804e3a76ac6f03749bb872027da1e67fc695f8e72425410358d5b28f0e425f8fc872332da1639d7132
|
data/.rubocop.yml
CHANGED
data/README.md
CHANGED
@@ -410,7 +410,7 @@ You can enable it, set the following environment variable:s
|
|
410
410
|
|
411
411
|
``SIMPLECOV=yes``
|
412
412
|
|
413
|
-
Remember to add the simplecov-console
|
413
|
+
Remember to add the simplecov-console gem to your `Gemfile`. If you run `spec:simplecov` on Travis-CI or any of the other supported CI services, reports get generated which can then be uploaded to [codecov.io](https://codecov.io) with the recommended [codecov uploader](https://docs.codecov.com/docs/codecov-uploader).
|
414
414
|
|
415
415
|
Some Notes for Windows Users
|
416
416
|
============================
|
@@ -20,35 +20,42 @@ env_module_path = ENV.fetch('MODULEPATH', nil)
|
|
20
20
|
module_path = File.join(fixture_path, 'modules')
|
21
21
|
|
22
22
|
module_path = [module_path, env_module_path].join(File::PATH_SEPARATOR) if env_module_path
|
23
|
+
|
23
24
|
if ENV['SIMPLECOV'] == 'yes'
|
24
25
|
begin
|
25
26
|
require 'simplecov'
|
26
27
|
require 'simplecov-console'
|
28
|
+
rescue LoadError
|
29
|
+
raise 'Add the simplecov and simplecov-console gems to Gemfile to enable this task'
|
30
|
+
end
|
31
|
+
|
32
|
+
SimpleCov.formatters = [
|
33
|
+
SimpleCov::Formatter::HTMLFormatter,
|
34
|
+
SimpleCov::Formatter::Console
|
35
|
+
]
|
36
|
+
|
37
|
+
begin
|
27
38
|
require 'codecov'
|
39
|
+
SimpleCov.formatters << SimpleCov::Formatter::Codecov
|
40
|
+
rescue LoadError
|
41
|
+
# continue without codecov, we could warn here but we want to avoid its use if possible
|
42
|
+
end
|
43
|
+
|
44
|
+
SimpleCov.start do
|
45
|
+
track_files 'lib/**/*.rb'
|
46
|
+
add_filter '/spec'
|
28
47
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
add_filter '/vendor'
|
40
|
-
add_filter '/.vendor'
|
41
|
-
|
42
|
-
# do not track gitignored files
|
43
|
-
# this adds about 4 seconds to the coverage check
|
44
|
-
# this could definitely be optimized
|
45
|
-
add_filter do |f|
|
46
|
-
# system returns true if exit status is 0, which with git-check-ignore means file is ignored
|
47
|
-
system("git check-ignore --quiet #{f.filename}")
|
48
|
-
end
|
48
|
+
# do not track vendored files
|
49
|
+
add_filter '/vendor'
|
50
|
+
add_filter '/.vendor'
|
51
|
+
|
52
|
+
# do not track gitignored files
|
53
|
+
# this adds about 4 seconds to the coverage check
|
54
|
+
# this could definitely be optimized
|
55
|
+
add_filter do |f|
|
56
|
+
# system returns true if exit status is 0, which with git-check-ignore means file is ignored
|
57
|
+
system("git check-ignore --quiet #{f.filename}")
|
49
58
|
end
|
50
|
-
rescue LoadError
|
51
|
-
raise 'Add the simplecov, simplecov-console, codecov gems to Gemfile to enable this task'
|
52
59
|
end
|
53
60
|
end
|
54
61
|
|
@@ -58,7 +65,7 @@ components = module_path.split(File::PATH_SEPARATOR).map do |dir|
|
|
58
65
|
|
59
66
|
Dir.entries(dir).grep_v(/^\./).map { |f| File.join(dir, f, 'spec', 'lib') }
|
60
67
|
end
|
61
|
-
components.flatten.each do |d|
|
68
|
+
components.compact.flatten.each do |d|
|
62
69
|
$LOAD_PATH << d if FileTest.directory?(d) && !$LOAD_PATH.include?(d)
|
63
70
|
end
|
64
71
|
|
data/spec/spec_helper.rb
CHANGED
@@ -1,15 +1,25 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
if ENV['COVERAGE'] == 'yes'
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
begin
|
5
|
+
require 'simplecov'
|
6
|
+
require 'simplecov-console'
|
7
|
+
rescue LoadError
|
8
|
+
raise 'Add the simplecov and simplecov-console gems to Gemfile to enable this task'
|
9
|
+
end
|
7
10
|
|
8
11
|
SimpleCov.formatters = [
|
9
12
|
SimpleCov::Formatter::HTMLFormatter,
|
10
|
-
SimpleCov::Formatter::Console
|
11
|
-
SimpleCov::Formatter::Codecov
|
13
|
+
SimpleCov::Formatter::Console
|
12
14
|
]
|
15
|
+
|
16
|
+
begin
|
17
|
+
require 'codecov'
|
18
|
+
SimpleCov.formatters << SimpleCov::Formatter::Codecov
|
19
|
+
rescue LoadError
|
20
|
+
# continue without codecov, we could warn here but we want to avoid if possible
|
21
|
+
end
|
22
|
+
|
13
23
|
SimpleCov.start do
|
14
24
|
track_files 'lib/**/*.rb'
|
15
25
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppetlabs_spec_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.0.
|
4
|
+
version: 7.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Puppet, Inc.
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-01-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mocha
|