puppetlabs_spec_helper 7.3.1 → 7.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 139276e5721239e25b613a18b8c96ea93235f9717dfea2522f3c597ca4f98996
4
- data.tar.gz: 8c8c252953c527d1da8add48267246261c27bbe30c7186e7ab4d960e0840665e
3
+ metadata.gz: a36cef853b9fb2b00ccda0994669722f01209bca6341ed3bfe07acae8475e08c
4
+ data.tar.gz: 155d86fa1f146094e975dbe60f3f4696b5eab2df34f9d4b4c7dfade4d5708e43
5
5
  SHA512:
6
- metadata.gz: 2fd1740c635a65b214e9fa83f639d519ba4569b45862ab0a6f7cd5b60fa3de9c1fb0f099ad45b2fe91b85eee1116359e02cb6dbc5ce4e8477fc6f1e3c280a3df
7
- data.tar.gz: cc1162520fb1db194506d43502f7b6cd395577c4312bc5c737c2272ac8aefbaf5767cfd7eb414d465036be79eb2ac2bd30a49e108f677aee254bbcdac30dd161
6
+ metadata.gz: 3c330c348badae2b51fd81aebc3a9f9143a1e8c82ffc0273a9cb7e95ce71c9702f5d8cde33d0af014fedcf27dd62b38fb1c0edd9063b0f3998da9f3786a32b1a
7
+ data.tar.gz: 6852485e9517b2984072af1171f252619d07455756fb694e999c78f23272c17e9cb17bb598f8aa8c0799fec8d6d2998679b11aa820c98e365dc67ea72a3e8f30
data/.rubocop.yml CHANGED
@@ -1,18 +1,8 @@
1
+ ---
1
2
  inherit_from: .rubocop_todo.yml
2
3
 
3
- require:
4
- - rubocop-performance
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:
@@ -31,7 +31,7 @@ if ENV['SIMPLECOV'] == 'yes'
31
31
 
32
32
  SimpleCov.formatters = [
33
33
  SimpleCov::Formatter::HTMLFormatter,
34
- SimpleCov::Formatter::Console
34
+ SimpleCov::Formatter::Console,
35
35
  ]
36
36
 
37
37
  begin
@@ -39,7 +39,7 @@ module PuppetlabsSpec
39
39
  # exposed hack.
40
40
  return nil unless Puppet::Parser::Functions.function(name)
41
41
 
42
- scope.method("function_#{name}".to_sym)
42
+ scope.method(:"function_#{name}")
43
43
  end
44
44
  module_function :function_method
45
45
  end
@@ -381,16 +381,16 @@ def create_gch_task(changelog_user = nil, changelog_project = nil, changelog_sin
381
381
  config.configure_sections = {
382
382
  'Changed' => {
383
383
  'prefix' => '### Changed',
384
- 'labels' => ['backwards-incompatible']
384
+ 'labels' => ['backwards-incompatible'],
385
385
  },
386
386
  'Added' => {
387
387
  'prefix' => '### Added',
388
- 'labels' => %w[feature enhancement]
388
+ 'labels' => %w[feature enhancement],
389
389
  },
390
390
  'Fixed' => {
391
391
  'prefix' => '### Fixed',
392
- 'labels' => ['bugfix']
393
- }
392
+ 'labels' => ['bugfix'],
393
+ },
394
394
  }
395
395
  end
396
396
  else
@@ -9,12 +9,12 @@ module PuppetlabsSpecHelper
9
9
  DEFAULT_IGNORED = [
10
10
  '/.git/',
11
11
  '/.bundle/',
12
- '/vendor/'
12
+ '/vendor/',
13
13
  ].freeze
14
14
 
15
15
  IGNORE_LIST_FILES = [
16
16
  '.pdkignore',
17
- '.gitignore'
17
+ '.gitignore',
18
18
  ].freeze
19
19
 
20
20
  def check(dir = Dir.pwd)
@@ -106,7 +106,7 @@ module PuppetlabsSpecHelper
106
106
  end
107
107
 
108
108
  fixtures = fixtures['fixtures']
109
- fixtures['symlinks'] = fixtures['symlinks'].nil? || fixtures['symlinks'].empty? ? auto_symlink : auto_symlink.merge!(fixtures['symlinks'])
109
+ fixtures['symlinks'] = (fixtures['symlinks'].nil? || fixtures['symlinks'].empty?) ? auto_symlink : auto_symlink.merge!(fixtures['symlinks'])
110
110
 
111
111
  result = {}
112
112
  if fixtures.include?(category) && !fixtures[category].nil?
@@ -317,7 +317,7 @@ module PuppetlabsSpecHelper
317
317
  end
318
318
  end
319
319
  # wait for all the threads to finish
320
- items.each { |_remote, opts| opts[:thread].join }
320
+ items.each_value { |opts| opts[:thread].join }
321
321
  end
322
322
 
323
323
  # @param target [String] - the target directory
@@ -427,12 +427,12 @@ end
427
427
 
428
428
  desc 'Clean up the fixtures directory'
429
429
  task :spec_clean do
430
- repositories.each do |_remote, opts|
430
+ repositories.each_value do |opts|
431
431
  target = opts['target']
432
432
  FileUtils.rm_rf(target)
433
433
  end
434
434
 
435
- forge_modules.each do |_remote, opts|
435
+ forge_modules.each_value do |opts|
436
436
  target = opts['target']
437
437
  FileUtils.rm_rf(target)
438
438
  end
@@ -446,7 +446,7 @@ end
446
446
 
447
447
  desc 'Clean up any fixture symlinks'
448
448
  task :spec_clean_symlinks do
449
- fixtures('symlinks').each do |_source, opts|
449
+ fixtures('symlinks').each_value do |opts|
450
450
  target = opts['target']
451
451
  FileUtils.rm_f(target)
452
452
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PuppetlabsSpecHelper
4
- VERSION = '7.3.1'
4
+ VERSION = '7.4.0'
5
5
  end
data/spec/spec_helper.rb CHANGED
@@ -10,7 +10,7 @@ if ENV['COVERAGE'] == 'yes'
10
10
 
11
11
  SimpleCov.formatters = [
12
12
  SimpleCov::Formatter::HTMLFormatter,
13
- SimpleCov::Formatter::Console
13
+ SimpleCov::Formatter::Console,
14
14
  ]
15
15
 
16
16
  SimpleCov.start do
@@ -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: 7.3.1
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: 2024-06-06 00:00:00.000000000 Z
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: 2.0.0
43
+ version: '3'
38
44
  type: :runtime
39
45
  prerelease: false
40
46
  version_requirements: !ruby/object:Gem::Requirement
@@ -44,7 +50,7 @@ dependencies:
44
50
  version: '0.2'
45
51
  - - "<"
46
52
  - !ruby/object:Gem::Version
47
- version: 2.0.0
53
+ version: '3'
48
54
  - !ruby/object:Gem::Dependency
49
55
  name: puppet-lint
50
56
  requirement: !ruby/object:Gem::Requirement
@@ -99,14 +105,28 @@ dependencies:
99
105
  requirements:
100
106
  - - "~>"
101
107
  - !ruby/object:Gem::Version
102
- version: '4.0'
108
+ version: '5.0'
103
109
  type: :runtime
104
110
  prerelease: false
105
111
  version_requirements: !ruby/object:Gem::Requirement
106
112
  requirements:
107
113
  - - "~>"
108
114
  - !ruby/object:Gem::Version
109
- version: '4.0'
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
110
130
  description: Contains rake tasks and a standard spec_helper for running spec tests
111
131
  on puppet modules.
112
132
  email: