puppetlabs_spec_helper 7.0.1 → 7.1.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9d5d1796b2e30abe46028bb3f3fab3e18f13aee48b873e284d875e4b813fea4c
4
- data.tar.gz: c4f302f2e7582d5f675dc8d3565faea0ef09027f56a526b2953188202e3f7d8f
3
+ metadata.gz: edd514b30513c5b65e91cef3cc8c7c1dc4c915e60f0cf22b6de05ae6ac6c677b
4
+ data.tar.gz: 49c7c02b201d96ed2c61d56bd6f0fa2ab2f93046289ff9b7b06362b998875576
5
5
  SHA512:
6
- metadata.gz: ede69c3256cdc38e5c80abdf673e5cc54976d94e077bcfd8e6eb8bf95bc6c63035509b2eede4d59ddb124a2f2d5a62ccd418dcfeb6af43ca5a8a74f415e635e2
7
- data.tar.gz: 2a4aaf6d1bac8c3f9733a35fda9af5d7cce91a2a27da7d82fc2596d46d832d7c932aa95ea6dbbf7b1daae5f702071bf2cbe0b32c1af71f6616d52f72cd32735a
6
+ metadata.gz: 4a72a59fda519d64431d6f41b8e68cfcaddf090df0a71113e5b749f6051450066167656abd12f637d8b68539c16c9d8674493818d973db39825fb5033de4e27d
7
+ data.tar.gz: 64b379b436e1371f9856a93f6bfd20c3e5fb68c501eca80d611fd71b4b6f145f3a0b0470386af7d0a2e78398d7fe254f00517a0cb1f77c1b63d3f0036bb38dda
data/.rubocop.yml CHANGED
@@ -17,3 +17,6 @@ AllCops:
17
17
  # Disabled
18
18
  Style/ClassAndModuleChildren:
19
19
  Enabled: false
20
+
21
+ Layout/LineLength:
22
+ Max: 200
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 and codecov gems to your `Gemfile`. If you run `spec:simplecov` on Travis-CI or any of the other supported CI services, reports gets automatically uploaded to https://codecov.io/ .
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
- SimpleCov.formatters = [
30
- SimpleCov::Formatter::HTMLFormatter,
31
- SimpleCov::Formatter::Console,
32
- SimpleCov::Formatter::Codecov
33
- ]
34
- SimpleCov.start do
35
- track_files 'lib/**/*.rb'
36
- add_filter '/spec'
37
-
38
- # do not track vendored files
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
 
@@ -176,7 +176,7 @@ puppet_lint_disable_checks = %w[
176
176
  ]
177
177
 
178
178
  puppet_lint_disable_checks.each do |check|
179
- PuppetLint.configuration.send("disable_#{check}")
179
+ PuppetLint.configuration.send(:"disable_#{check}")
180
180
  end
181
181
  PuppetLint::RakeTask.new(:lint)
182
182
 
@@ -192,6 +192,8 @@ PuppetSyntax.exclude_paths << 'pkg/**/*'
192
192
  PuppetSyntax.exclude_paths << 'vendor/**/*'
193
193
  PuppetSyntax.exclude_paths << '.vendor/**/*'
194
194
  PuppetSyntax.exclude_paths << 'plans/**/*'
195
+ PuppetSyntax.check_hiera_keys = true
196
+ PuppetSyntax.check_hiera_data = true
195
197
 
196
198
  desc 'Check syntax of Ruby files and call :syntax and :metadata_lint'
197
199
  task :validate do
@@ -106,8 +106,7 @@ module PuppetlabsSpecHelper
106
106
  end
107
107
 
108
108
  fixtures = fixtures['fixtures']
109
-
110
- fixtures['symlinks'] = auto_symlink if fixtures['symlinks'].nil?
109
+ fixtures['symlinks'] = fixtures['symlinks'].nil? || fixtures['symlinks'].empty? ? auto_symlink : auto_symlink.merge!(fixtures['symlinks'])
111
110
 
112
111
  result = {}
113
112
  if fixtures.include?(category) && !fixtures[category].nil?
@@ -151,7 +150,7 @@ module PuppetlabsSpecHelper
151
150
  return hash unless hash['scm'] == 'git'
152
151
 
153
152
  # Forward slashes in the ref aren't allowed. And is probably a branch name.
154
- raise ArgumentError, "The ref for #{hash['target']} is invalid (Contains a forward slash). If this is a branch name, please use the 'branch' setting instead." if hash['ref'].include?('/')
153
+ raise ArgumentError, "The ref for #{hash['target']} is invalid (Contains a forward slash). If this is a branch name, please use the 'branch' setting instead." if hash['ref']&.include?('/')
155
154
 
156
155
  hash
157
156
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PuppetlabsSpecHelper
4
- VERSION = '7.0.1'
4
+ VERSION = '7.1.0'
5
5
  end
data/spec/spec_helper.rb CHANGED
@@ -1,15 +1,18 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  if ENV['COVERAGE'] == 'yes'
4
- require 'simplecov'
5
- require 'simplecov-console'
6
- require 'codecov'
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
+
13
16
  SimpleCov.start do
14
17
  track_files 'lib/**/*.rb'
15
18
 
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.1
4
+ version: 7.1.0
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: 2023-11-22 00:00:00.000000000 Z
12
+ date: 2024-03-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mocha
@@ -65,14 +65,14 @@ dependencies:
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '3.0'
68
+ version: '4.1'
69
69
  type: :runtime
70
70
  prerelease: false
71
71
  version_requirements: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '3.0'
75
+ version: '4.1'
76
76
  - !ruby/object:Gem::Dependency
77
77
  name: rspec-github
78
78
  requirement: !ruby/object:Gem::Requirement