puppetlabs_spec_helper 6.0.1 → 7.4.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 +4 -4
- data/.rubocop.yml +6 -13
- data/README.md +19 -11
- data/lib/puppetlabs_spec_helper/module_spec_helper.rb +30 -24
- data/lib/puppetlabs_spec_helper/puppetlabs_spec/puppet_internals.rb +1 -1
- data/lib/puppetlabs_spec_helper/rake_tasks.rb +10 -8
- data/lib/puppetlabs_spec_helper/tasks/check_symlinks.rb +2 -2
- data/lib/puppetlabs_spec_helper/tasks/fixtures.rb +6 -7
- data/lib/puppetlabs_spec_helper/version.rb +1 -1
- data/spec/spec_helper.rb +7 -4
- data/spec/unit/puppetlabs_spec_helper/tasks/check_symlinks_spec.rb +13 -13
- data/spec/unit/puppetlabs_spec_helper/tasks/check_test_file_spec.rb +1 -1
- data/spec/unit/puppetlabs_spec_helper/tasks/fixture_helpers_spec.rb +16 -16
- data/spec/watchr.rb +1 -1
- metadata +42 -16
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a36cef853b9fb2b00ccda0994669722f01209bca6341ed3bfe07acae8475e08c
|
|
4
|
+
data.tar.gz: 155d86fa1f146094e975dbe60f3f4696b5eab2df34f9d4b4c7dfade4d5708e43
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3c330c348badae2b51fd81aebc3a9f9143a1e8c82ffc0273a9cb7e95ce71c9702f5d8cde33d0af014fedcf27dd62b38fb1c0edd9063b0f3998da9f3786a32b1a
|
|
7
|
+
data.tar.gz: 6852485e9517b2984072af1171f252619d07455756fb694e999c78f23272c17e9cb17bb598f8aa8c0799fec8d6d2998679b11aa820c98e365dc67ea72a3e8f30
|
data/.rubocop.yml
CHANGED
|
@@ -1,19 +1,12 @@
|
|
|
1
|
+
---
|
|
1
2
|
inherit_from: .rubocop_todo.yml
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
- rubocop
|
|
5
|
-
- rubocop-rspec
|
|
6
|
-
|
|
7
|
-
AllCops:
|
|
8
|
-
Exclude:
|
|
9
|
-
- Gemfile
|
|
10
|
-
- Rakefile
|
|
11
|
-
- spec/fixtures/**/*
|
|
12
|
-
- vendor/bundle/**/*
|
|
13
|
-
NewCops: enable
|
|
14
|
-
SuggestExtensions: false
|
|
15
|
-
TargetRubyVersion: '2.7'
|
|
4
|
+
inherit_gem:
|
|
5
|
+
voxpupuli-rubocop: rubocop.yml
|
|
16
6
|
|
|
17
7
|
# Disabled
|
|
18
8
|
Style/ClassAndModuleChildren:
|
|
19
9
|
Enabled: false
|
|
10
|
+
|
|
11
|
+
Layout/LineLength:
|
|
12
|
+
Max: 200
|
data/README.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
Puppet Labs Spec Helper
|
|
2
2
|
=======================
|
|
3
3
|
|
|
4
|
+
[](https://github.com/puppetlabs/puppetlabs_spec_helper/blob/main/CODEOWNERS)
|
|
5
|
+

|
|
6
|
+

|
|
7
|
+
|
|
4
8
|
The Short Version
|
|
5
9
|
-----------------
|
|
6
10
|
|
|
@@ -230,8 +234,8 @@ Add `firewall` and `stdlib` as required module fixtures:
|
|
|
230
234
|
```yaml
|
|
231
235
|
fixtures:
|
|
232
236
|
repositories:
|
|
233
|
-
firewall: "
|
|
234
|
-
stdlib: "
|
|
237
|
+
firewall: "https://github.com/puppetlabs/puppetlabs-firewall.git"
|
|
238
|
+
stdlib: "https://github.com/puppetlabs/puppetlabs-stdlib.git"
|
|
235
239
|
```
|
|
236
240
|
|
|
237
241
|
Put a supplementary repository at a different location
|
|
@@ -239,8 +243,8 @@ Put a supplementary repository at a different location
|
|
|
239
243
|
```yaml
|
|
240
244
|
fixtures:
|
|
241
245
|
repositories:
|
|
242
|
-
firewall: "
|
|
243
|
-
stdlib: "
|
|
246
|
+
firewall: "https://github.com/puppetlabs/puppetlabs-firewall.git"
|
|
247
|
+
stdlib: "https://github.com/puppetlabs/puppetlabs-stdlib.git"
|
|
244
248
|
control_repo:
|
|
245
249
|
repo: "https://github.com/puppetlabs/control-repo"
|
|
246
250
|
target: "spec/fixtures/control_repos"
|
|
@@ -251,9 +255,9 @@ Specify that the git tag `2.4.2` of `stdlib` should be checked out:
|
|
|
251
255
|
```yaml
|
|
252
256
|
fixtures:
|
|
253
257
|
repositories:
|
|
254
|
-
firewall: "
|
|
258
|
+
firewall: "https://github.com/puppetlabs/puppetlabs-firewall.git"
|
|
255
259
|
stdlib:
|
|
256
|
-
repo: "
|
|
260
|
+
repo: "https://github.com/puppetlabs/puppetlabs-stdlib.git"
|
|
257
261
|
ref: "2.6.0"
|
|
258
262
|
```
|
|
259
263
|
|
|
@@ -263,7 +267,7 @@ Only install the `yumrepo_core` module when testing against Puppet 7 or greater:
|
|
|
263
267
|
fixtures:
|
|
264
268
|
repositories:
|
|
265
269
|
yumrepo_core:
|
|
266
|
-
repo: "
|
|
270
|
+
repo: "https://github.com/puppetlabs/puppetlabs-yumrepo_core.git"
|
|
267
271
|
puppet_version: ">= 6.0.0"
|
|
268
272
|
```
|
|
269
273
|
|
|
@@ -273,7 +277,7 @@ Move manifests and siblings to root directory when they are inside a `code` dire
|
|
|
273
277
|
fixtures:
|
|
274
278
|
repositories:
|
|
275
279
|
stdlib:
|
|
276
|
-
repo: "
|
|
280
|
+
repo: "https://github.com/puppetlabs/puppetlabs-extradirectory.git"
|
|
277
281
|
subdir: "code"
|
|
278
282
|
```
|
|
279
283
|
|
|
@@ -299,7 +303,7 @@ fixtures:
|
|
|
299
303
|
flags: "--module_repository https://my_repo.com"
|
|
300
304
|
repositories:
|
|
301
305
|
firewall:
|
|
302
|
-
repo: "
|
|
306
|
+
repo: "https://github.com/puppetlabs/puppetlabs-firewall.git"
|
|
303
307
|
ref: "2.6.0"
|
|
304
308
|
flags: "--verbose"
|
|
305
309
|
```
|
|
@@ -317,7 +321,7 @@ fixtures:
|
|
|
317
321
|
ref: "2.6.0"
|
|
318
322
|
repositories:
|
|
319
323
|
firewall:
|
|
320
|
-
repo: "
|
|
324
|
+
repo: "https://github.com/puppetlabs/puppetlabs-firewall.git"
|
|
321
325
|
ref: "2.6.0"
|
|
322
326
|
```
|
|
323
327
|
|
|
@@ -406,7 +410,7 @@ You can enable it, set the following environment variable:s
|
|
|
406
410
|
|
|
407
411
|
``SIMPLECOV=yes``
|
|
408
412
|
|
|
409
|
-
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).
|
|
410
414
|
|
|
411
415
|
Some Notes for Windows Users
|
|
412
416
|
============================
|
|
@@ -481,3 +485,7 @@ Rationale
|
|
|
481
485
|
* mocha is an additional dependency to carry.
|
|
482
486
|
|
|
483
487
|
EOF
|
|
488
|
+
|
|
489
|
+
## License
|
|
490
|
+
|
|
491
|
+
This codebase is licensed under Apache 2.0. However, the open source dependencies included in this codebase might be subject to other software licenses such as AGPL, GPL2.0, and MIT.
|
|
@@ -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
|
|
|
@@ -67,7 +74,6 @@ RSpec.configure do |c|
|
|
|
67
74
|
|
|
68
75
|
c.environmentpath = spec_path
|
|
69
76
|
c.module_path = module_path
|
|
70
|
-
c.manifest_dir = File.join(fixture_path, 'manifests')
|
|
71
77
|
|
|
72
78
|
# https://github.com/puppetlabs/rspec-puppet#strict_variables
|
|
73
79
|
c.strict_variables = ENV['STRICT_VARIABLES'] != 'no'
|
|
@@ -111,8 +111,9 @@ task :parallel_spec_standalone do |_t, args|
|
|
|
111
111
|
warn 'No files for parallel_spec to run against'
|
|
112
112
|
else
|
|
113
113
|
|
|
114
|
-
args = ['
|
|
115
|
-
|
|
114
|
+
args = ['--type', 'rspec']
|
|
115
|
+
additional_options = ['--format', 'progress'] + ENV['CI_SPEC_OPTIONS'].to_s.strip.split
|
|
116
|
+
args.push('--').concat(additional_options).push('--')
|
|
116
117
|
args.concat(Rake::FileList[pattern].to_a)
|
|
117
118
|
|
|
118
119
|
ParallelTests::CLI.new.run(args)
|
|
@@ -176,7 +177,7 @@ puppet_lint_disable_checks = %w[
|
|
|
176
177
|
]
|
|
177
178
|
|
|
178
179
|
puppet_lint_disable_checks.each do |check|
|
|
179
|
-
PuppetLint.configuration.send("disable_#{check}")
|
|
180
|
+
PuppetLint.configuration.send(:"disable_#{check}")
|
|
180
181
|
end
|
|
181
182
|
PuppetLint::RakeTask.new(:lint)
|
|
182
183
|
|
|
@@ -191,7 +192,8 @@ PuppetSyntax.exclude_paths << 'spec/fixtures/**/*'
|
|
|
191
192
|
PuppetSyntax.exclude_paths << 'pkg/**/*'
|
|
192
193
|
PuppetSyntax.exclude_paths << 'vendor/**/*'
|
|
193
194
|
PuppetSyntax.exclude_paths << '.vendor/**/*'
|
|
194
|
-
PuppetSyntax.
|
|
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
|
|
@@ -379,16 +381,16 @@ def create_gch_task(changelog_user = nil, changelog_project = nil, changelog_sin
|
|
|
379
381
|
config.configure_sections = {
|
|
380
382
|
'Changed' => {
|
|
381
383
|
'prefix' => '### Changed',
|
|
382
|
-
'labels' => ['backwards-incompatible']
|
|
384
|
+
'labels' => ['backwards-incompatible'],
|
|
383
385
|
},
|
|
384
386
|
'Added' => {
|
|
385
387
|
'prefix' => '### Added',
|
|
386
|
-
'labels' => %w[feature enhancement]
|
|
388
|
+
'labels' => %w[feature enhancement],
|
|
387
389
|
},
|
|
388
390
|
'Fixed' => {
|
|
389
391
|
'prefix' => '### Fixed',
|
|
390
|
-
'labels' => ['bugfix']
|
|
391
|
-
}
|
|
392
|
+
'labels' => ['bugfix'],
|
|
393
|
+
},
|
|
392
394
|
}
|
|
393
395
|
end
|
|
394
396
|
else
|
|
@@ -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']
|
|
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
|
|
@@ -318,7 +317,7 @@ module PuppetlabsSpecHelper
|
|
|
318
317
|
end
|
|
319
318
|
end
|
|
320
319
|
# wait for all the threads to finish
|
|
321
|
-
items.
|
|
320
|
+
items.each_value { |opts| opts[:thread].join }
|
|
322
321
|
end
|
|
323
322
|
|
|
324
323
|
# @param target [String] - the target directory
|
|
@@ -428,12 +427,12 @@ end
|
|
|
428
427
|
|
|
429
428
|
desc 'Clean up the fixtures directory'
|
|
430
429
|
task :spec_clean do
|
|
431
|
-
repositories.
|
|
430
|
+
repositories.each_value do |opts|
|
|
432
431
|
target = opts['target']
|
|
433
432
|
FileUtils.rm_rf(target)
|
|
434
433
|
end
|
|
435
434
|
|
|
436
|
-
forge_modules.
|
|
435
|
+
forge_modules.each_value do |opts|
|
|
437
436
|
target = opts['target']
|
|
438
437
|
FileUtils.rm_rf(target)
|
|
439
438
|
end
|
|
@@ -447,7 +446,7 @@ end
|
|
|
447
446
|
|
|
448
447
|
desc 'Clean up any fixture symlinks'
|
|
449
448
|
task :spec_clean_symlinks do
|
|
450
|
-
fixtures('symlinks').
|
|
449
|
+
fixtures('symlinks').each_value do |opts|
|
|
451
450
|
target = opts['target']
|
|
452
451
|
FileUtils.rm_f(target)
|
|
453
452
|
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
|
-
|
|
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
13
|
SimpleCov::Formatter::Console,
|
|
11
|
-
SimpleCov::Formatter::Codecov
|
|
12
14
|
]
|
|
15
|
+
|
|
13
16
|
SimpleCov.start do
|
|
14
17
|
track_files 'lib/**/*.rb'
|
|
15
18
|
|
|
@@ -31,7 +31,7 @@ describe 'rake check:symlinks', type: :task do
|
|
|
31
31
|
let(:test_files) do
|
|
32
32
|
[
|
|
33
33
|
File.join(Dir.pwd, 'files', 'a_file.pp'),
|
|
34
|
-
File.join(Dir.pwd, 'files', 'another_file.pp')
|
|
34
|
+
File.join(Dir.pwd, 'files', 'another_file.pp'),
|
|
35
35
|
]
|
|
36
36
|
end
|
|
37
37
|
|
|
@@ -43,13 +43,13 @@ describe 'rake check:symlinks', type: :task do
|
|
|
43
43
|
context 'when there is a symlink present' do
|
|
44
44
|
let(:test_files) do
|
|
45
45
|
[
|
|
46
|
-
File.join(Dir.pwd, 'files', 'a_file.pp')
|
|
46
|
+
File.join(Dir.pwd, 'files', 'a_file.pp'),
|
|
47
47
|
]
|
|
48
48
|
end
|
|
49
49
|
|
|
50
50
|
let(:symlinks) do
|
|
51
51
|
{
|
|
52
|
-
File.join(Dir.pwd, 'files', 'a_symlink.pp') => File.join(Dir.pwd, 'files', 'a_file.pp')
|
|
52
|
+
File.join(Dir.pwd, 'files', 'a_symlink.pp') => File.join(Dir.pwd, 'files', 'a_file.pp'),
|
|
53
53
|
}
|
|
54
54
|
end
|
|
55
55
|
|
|
@@ -63,13 +63,13 @@ describe 'rake check:symlinks', type: :task do
|
|
|
63
63
|
context 'when there are symlinks under .git/' do
|
|
64
64
|
let(:test_files) do
|
|
65
65
|
[
|
|
66
|
-
File.join(Dir.pwd, 'files', 'a_file.pp')
|
|
66
|
+
File.join(Dir.pwd, 'files', 'a_file.pp'),
|
|
67
67
|
]
|
|
68
68
|
end
|
|
69
69
|
|
|
70
70
|
let(:symlinks) do
|
|
71
71
|
{
|
|
72
|
-
File.join(Dir.pwd, '.git', 'a_symlink.pp') => File.join(Dir.pwd, 'files', 'a_file.pp')
|
|
72
|
+
File.join(Dir.pwd, '.git', 'a_symlink.pp') => File.join(Dir.pwd, 'files', 'a_file.pp'),
|
|
73
73
|
}
|
|
74
74
|
end
|
|
75
75
|
|
|
@@ -81,13 +81,13 @@ describe 'rake check:symlinks', type: :task do
|
|
|
81
81
|
context 'when there are symlinks under .bundle/' do
|
|
82
82
|
let(:test_files) do
|
|
83
83
|
[
|
|
84
|
-
File.join(Dir.pwd, 'files', 'a_file.pp')
|
|
84
|
+
File.join(Dir.pwd, 'files', 'a_file.pp'),
|
|
85
85
|
]
|
|
86
86
|
end
|
|
87
87
|
|
|
88
88
|
let(:symlinks) do
|
|
89
89
|
{
|
|
90
|
-
File.join(Dir.pwd, '.bundle', 'a_symlink.pp') => File.join(Dir.pwd, 'files', 'a_file.pp')
|
|
90
|
+
File.join(Dir.pwd, '.bundle', 'a_symlink.pp') => File.join(Dir.pwd, 'files', 'a_file.pp'),
|
|
91
91
|
}
|
|
92
92
|
end
|
|
93
93
|
|
|
@@ -99,13 +99,13 @@ describe 'rake check:symlinks', type: :task do
|
|
|
99
99
|
context 'when there are symlinks under vendor/' do
|
|
100
100
|
let(:test_files) do
|
|
101
101
|
[
|
|
102
|
-
File.join(Dir.pwd, 'files', 'a_file.pp')
|
|
102
|
+
File.join(Dir.pwd, 'files', 'a_file.pp'),
|
|
103
103
|
]
|
|
104
104
|
end
|
|
105
105
|
|
|
106
106
|
let(:symlinks) do
|
|
107
107
|
{
|
|
108
|
-
File.join(Dir.pwd, 'vendor', 'a_symlink.pp') => File.join(Dir.pwd, 'files', 'a_file.pp')
|
|
108
|
+
File.join(Dir.pwd, 'vendor', 'a_symlink.pp') => File.join(Dir.pwd, 'files', 'a_file.pp'),
|
|
109
109
|
}
|
|
110
110
|
end
|
|
111
111
|
|
|
@@ -121,13 +121,13 @@ describe 'rake check:symlinks', type: :task do
|
|
|
121
121
|
|
|
122
122
|
let(:test_files) do
|
|
123
123
|
[
|
|
124
|
-
File.join(Dir.pwd, 'files', 'a_file.pp')
|
|
124
|
+
File.join(Dir.pwd, 'files', 'a_file.pp'),
|
|
125
125
|
]
|
|
126
126
|
end
|
|
127
127
|
|
|
128
128
|
let(:symlinks) do
|
|
129
129
|
{
|
|
130
|
-
File.join(Dir.pwd, 'a_directory', 'a_symlink.pp') => File.join(Dir.pwd, 'files', 'a_file.pp')
|
|
130
|
+
File.join(Dir.pwd, 'a_directory', 'a_symlink.pp') => File.join(Dir.pwd, 'files', 'a_file.pp'),
|
|
131
131
|
}
|
|
132
132
|
end
|
|
133
133
|
|
|
@@ -145,13 +145,13 @@ describe 'rake check:symlinks', type: :task do
|
|
|
145
145
|
|
|
146
146
|
let(:test_files) do
|
|
147
147
|
[
|
|
148
|
-
File.join(Dir.pwd, 'files', 'a_file.pp')
|
|
148
|
+
File.join(Dir.pwd, 'files', 'a_file.pp'),
|
|
149
149
|
]
|
|
150
150
|
end
|
|
151
151
|
|
|
152
152
|
let(:symlinks) do
|
|
153
153
|
{
|
|
154
|
-
File.join(Dir.pwd, 'another_directory', 'a_symlink.pp') => File.join(Dir.pwd, 'files', 'a_file.pp')
|
|
154
|
+
File.join(Dir.pwd, 'another_directory', 'a_symlink.pp') => File.join(Dir.pwd, 'files', 'a_file.pp'),
|
|
155
155
|
}
|
|
156
156
|
end
|
|
157
157
|
|
|
@@ -14,7 +14,7 @@ describe 'rake check:test_file', type: :task do
|
|
|
14
14
|
let(:test_files) do
|
|
15
15
|
[
|
|
16
16
|
File.join(Dir.pwd, 'tests', 'an_example.pp'),
|
|
17
|
-
File.join(Dir.pwd, 'tests', 'deep', 'directory', 'structure', 'another_example.pp')
|
|
17
|
+
File.join(Dir.pwd, 'tests', 'deep', 'directory', 'structure', 'another_example.pp'),
|
|
18
18
|
]
|
|
19
19
|
end
|
|
20
20
|
|
|
@@ -141,7 +141,7 @@ describe PuppetlabsSpecHelper::Tasks::FixtureHelpers do
|
|
|
141
141
|
'branch' => nil,
|
|
142
142
|
'scm' => nil,
|
|
143
143
|
'flags' => nil,
|
|
144
|
-
'subdir' => nil
|
|
144
|
+
'subdir' => nil,
|
|
145
145
|
},
|
|
146
146
|
)
|
|
147
147
|
end
|
|
@@ -159,7 +159,7 @@ describe PuppetlabsSpecHelper::Tasks::FixtureHelpers do
|
|
|
159
159
|
'branch' => nil,
|
|
160
160
|
'scm' => nil,
|
|
161
161
|
'flags' => '--module_repository=https://myforge.example.com/',
|
|
162
|
-
'subdir' => nil
|
|
162
|
+
'subdir' => nil,
|
|
163
163
|
},
|
|
164
164
|
)
|
|
165
165
|
end
|
|
@@ -170,7 +170,7 @@ describe PuppetlabsSpecHelper::Tasks::FixtureHelpers do
|
|
|
170
170
|
allow(File).to receive(:exist?).with('.fixtures.yml').and_return true
|
|
171
171
|
allow(YAML).to receive(:load_file).with('.fixtures.yml').and_return(
|
|
172
172
|
'fixtures' => {
|
|
173
|
-
'repositories' => { 'stdlib' => 'https://github.com/puppetlabs/puppetlabs-stdlib.git' }
|
|
173
|
+
'repositories' => { 'stdlib' => 'https://github.com/puppetlabs/puppetlabs-stdlib.git' },
|
|
174
174
|
},
|
|
175
175
|
)
|
|
176
176
|
end
|
|
@@ -183,7 +183,7 @@ describe PuppetlabsSpecHelper::Tasks::FixtureHelpers do
|
|
|
183
183
|
'branch' => nil,
|
|
184
184
|
'scm' => nil,
|
|
185
185
|
'flags' => nil,
|
|
186
|
-
'subdir' => nil
|
|
186
|
+
'subdir' => nil,
|
|
187
187
|
},
|
|
188
188
|
)
|
|
189
189
|
end
|
|
@@ -198,9 +198,9 @@ describe PuppetlabsSpecHelper::Tasks::FixtureHelpers do
|
|
|
198
198
|
'stdlib' => {
|
|
199
199
|
'scm' => 'git',
|
|
200
200
|
'repo' => 'https://github.com/puppetlabs/puppetlabs-stdlib.git',
|
|
201
|
-
'ref' => 'this/is/a/branch'
|
|
202
|
-
}
|
|
203
|
-
}
|
|
201
|
+
'ref' => 'this/is/a/branch',
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
204
|
},
|
|
205
205
|
)
|
|
206
206
|
end
|
|
@@ -222,9 +222,9 @@ describe PuppetlabsSpecHelper::Tasks::FixtureHelpers do
|
|
|
222
222
|
'forge_modules' => {
|
|
223
223
|
'stdlib' => {
|
|
224
224
|
'repo' => 'puppetlabs-stdlib',
|
|
225
|
-
'puppet_version' => Puppet::PUPPETVERSION
|
|
226
|
-
}
|
|
227
|
-
}
|
|
225
|
+
'puppet_version' => Puppet::PUPPETVERSION,
|
|
226
|
+
},
|
|
227
|
+
},
|
|
228
228
|
},
|
|
229
229
|
)
|
|
230
230
|
expect(helper.fixtures('forge_modules')).to include('puppetlabs-stdlib')
|
|
@@ -236,9 +236,9 @@ describe PuppetlabsSpecHelper::Tasks::FixtureHelpers do
|
|
|
236
236
|
'forge_modules' => {
|
|
237
237
|
'stdlib' => {
|
|
238
238
|
'repo' => 'puppetlabs-stdlib',
|
|
239
|
-
'puppet_version' => '>= 999.9.9'
|
|
240
|
-
}
|
|
241
|
-
}
|
|
239
|
+
'puppet_version' => '>= 999.9.9',
|
|
240
|
+
},
|
|
241
|
+
},
|
|
242
242
|
},
|
|
243
243
|
)
|
|
244
244
|
expect(helper.fixtures('forge_modules')).to eq({})
|
|
@@ -250,9 +250,9 @@ describe PuppetlabsSpecHelper::Tasks::FixtureHelpers do
|
|
|
250
250
|
'forge_modules' => {
|
|
251
251
|
'stdlib' => {
|
|
252
252
|
'repo' => 'puppetlabs-stdlib',
|
|
253
|
-
'puppet_version' => Puppet::PUPPETVERSION
|
|
254
|
-
}
|
|
255
|
-
}
|
|
253
|
+
'puppet_version' => Puppet::PUPPETVERSION,
|
|
254
|
+
},
|
|
255
|
+
},
|
|
256
256
|
},
|
|
257
257
|
)
|
|
258
258
|
expect(helper.fixtures('forge_modules')).to include('puppetlabs-stdlib')
|
data/spec/watchr.rb
CHANGED
|
@@ -11,7 +11,7 @@ def growl(message)
|
|
|
11
11
|
title = 'Watchr Test Results'
|
|
12
12
|
image = case message
|
|
13
13
|
when /(\d+)\s+?(failure|error)/i
|
|
14
|
-
Regexp.last_match(1).to_i == 0 ? '~/.watchr_images/passed.png' : '~/.watchr_images/failed.png'
|
|
14
|
+
(Regexp.last_match(1).to_i == 0) ? '~/.watchr_images/passed.png' : '~/.watchr_images/failed.png'
|
|
15
15
|
else
|
|
16
16
|
'~/.watchr_images/unknown.png'
|
|
17
17
|
end
|
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:
|
|
4
|
+
version: 7.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Puppet, Inc.
|
|
@@ -9,22 +9,28 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date:
|
|
12
|
+
date: 2024-09-06 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: mocha
|
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
|
17
17
|
requirements:
|
|
18
|
-
- - "
|
|
18
|
+
- - ">="
|
|
19
19
|
- !ruby/object:Gem::Version
|
|
20
20
|
version: '1.0'
|
|
21
|
+
- - "<"
|
|
22
|
+
- !ruby/object:Gem::Version
|
|
23
|
+
version: '3'
|
|
21
24
|
type: :runtime
|
|
22
25
|
prerelease: false
|
|
23
26
|
version_requirements: !ruby/object:Gem::Requirement
|
|
24
27
|
requirements:
|
|
25
|
-
- - "
|
|
28
|
+
- - ">="
|
|
26
29
|
- !ruby/object:Gem::Version
|
|
27
30
|
version: '1.0'
|
|
31
|
+
- - "<"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '3'
|
|
28
34
|
- !ruby/object:Gem::Dependency
|
|
29
35
|
name: pathspec
|
|
30
36
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -34,7 +40,7 @@ dependencies:
|
|
|
34
40
|
version: '0.2'
|
|
35
41
|
- - "<"
|
|
36
42
|
- !ruby/object:Gem::Version
|
|
37
|
-
version:
|
|
43
|
+
version: '3'
|
|
38
44
|
type: :runtime
|
|
39
45
|
prerelease: false
|
|
40
46
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -44,35 +50,41 @@ dependencies:
|
|
|
44
50
|
version: '0.2'
|
|
45
51
|
- - "<"
|
|
46
52
|
- !ruby/object:Gem::Version
|
|
47
|
-
version:
|
|
53
|
+
version: '3'
|
|
48
54
|
- !ruby/object:Gem::Dependency
|
|
49
55
|
name: puppet-lint
|
|
50
56
|
requirement: !ruby/object:Gem::Requirement
|
|
51
57
|
requirements:
|
|
52
|
-
- - "
|
|
58
|
+
- - "~>"
|
|
53
59
|
- !ruby/object:Gem::Version
|
|
54
|
-
version:
|
|
60
|
+
version: '4.0'
|
|
55
61
|
type: :runtime
|
|
56
62
|
prerelease: false
|
|
57
63
|
version_requirements: !ruby/object:Gem::Requirement
|
|
58
64
|
requirements:
|
|
59
|
-
- - "
|
|
65
|
+
- - "~>"
|
|
60
66
|
- !ruby/object:Gem::Version
|
|
61
|
-
version:
|
|
67
|
+
version: '4.0'
|
|
62
68
|
- !ruby/object:Gem::Dependency
|
|
63
69
|
name: puppet-syntax
|
|
64
70
|
requirement: !ruby/object:Gem::Requirement
|
|
65
71
|
requirements:
|
|
66
72
|
- - "~>"
|
|
67
73
|
- !ruby/object:Gem::Version
|
|
68
|
-
version: '
|
|
74
|
+
version: '4.1'
|
|
75
|
+
- - ">="
|
|
76
|
+
- !ruby/object:Gem::Version
|
|
77
|
+
version: 4.1.1
|
|
69
78
|
type: :runtime
|
|
70
79
|
prerelease: false
|
|
71
80
|
version_requirements: !ruby/object:Gem::Requirement
|
|
72
81
|
requirements:
|
|
73
82
|
- - "~>"
|
|
74
83
|
- !ruby/object:Gem::Version
|
|
75
|
-
version: '
|
|
84
|
+
version: '4.1'
|
|
85
|
+
- - ">="
|
|
86
|
+
- !ruby/object:Gem::Version
|
|
87
|
+
version: 4.1.1
|
|
76
88
|
- !ruby/object:Gem::Dependency
|
|
77
89
|
name: rspec-github
|
|
78
90
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -91,16 +103,30 @@ dependencies:
|
|
|
91
103
|
name: rspec-puppet
|
|
92
104
|
requirement: !ruby/object:Gem::Requirement
|
|
93
105
|
requirements:
|
|
94
|
-
- - "
|
|
106
|
+
- - "~>"
|
|
95
107
|
- !ruby/object:Gem::Version
|
|
96
|
-
version: '
|
|
108
|
+
version: '5.0'
|
|
97
109
|
type: :runtime
|
|
98
110
|
prerelease: false
|
|
99
111
|
version_requirements: !ruby/object:Gem::Requirement
|
|
100
112
|
requirements:
|
|
101
|
-
- - "
|
|
113
|
+
- - "~>"
|
|
102
114
|
- !ruby/object:Gem::Version
|
|
103
|
-
version: '
|
|
115
|
+
version: '5.0'
|
|
116
|
+
- !ruby/object:Gem::Dependency
|
|
117
|
+
name: voxpupuli-rubocop
|
|
118
|
+
requirement: !ruby/object:Gem::Requirement
|
|
119
|
+
requirements:
|
|
120
|
+
- - "~>"
|
|
121
|
+
- !ruby/object:Gem::Version
|
|
122
|
+
version: 2.8.0
|
|
123
|
+
type: :development
|
|
124
|
+
prerelease: false
|
|
125
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
126
|
+
requirements:
|
|
127
|
+
- - "~>"
|
|
128
|
+
- !ruby/object:Gem::Version
|
|
129
|
+
version: 2.8.0
|
|
104
130
|
description: Contains rake tasks and a standard spec_helper for running spec tests
|
|
105
131
|
on puppet modules.
|
|
106
132
|
email:
|