voxpupuli-test 1.2.0 → 2.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: 77bc03767c8ec31c56ad01387b44f076da3f46a093ad7497ec72d3927b70725d
4
- data.tar.gz: a01ea0674defb7e51d80579e3aab0c0c46a04f994c2098fe08f8d9f020df2037
3
+ metadata.gz: d745fbc5827db89bff008ceea7f415ee870656b2f3375e2b5d39d6cb8603fe45
4
+ data.tar.gz: 9f6a7acc3bbcbef5325784bdd49ec228d2f3ce5f5cb4395ace8b448ef03298e6
5
5
  SHA512:
6
- metadata.gz: 1c04841db70904b8cb9b4da786bc51c9b5d6901c5fe519d8ab1375e08aa4aaf71aa3a23e5b8c3d7fc9321a1a436bdd37ba36be664453663538163766f20e0871
7
- data.tar.gz: bba1d56a532d2b118a3269ce502044216b402409b31790730f7f61e030d608a69f8dc69bd20aeaf0403d13fb4fcd28c3d2e657e09f40a06ee2cdd885c2f7cf87
6
+ metadata.gz: '088ca28eb46d3ed311a445416d921ad8963a0011c45592032330ad0111bdd51349cc9e0d64b2b8614fb529b37057e1dea16d8d899cc3a5242ed7290663f08fad'
7
+ data.tar.gz: c836147f89558f2780ebe754ce64f97db24dbd287ae198161cdac31ffec93ed359d377ee85bb0cbd239d0a849573b5b002959fae11f36bd015e4092cb599d216
@@ -0,0 +1,34 @@
1
+ # Override facts
2
+ #
3
+ # This doesn't use deep_merge because that's highly unpredictable. It can merge
4
+ # nested hashes in place, modifying the original. It's also unable to override
5
+ # true to false.
6
+ #
7
+ # A deep copy is obtained by using Marshal so it can be modified in place. Then
8
+ # it recursively overrides values. If the result is a hash, it's recursed into.
9
+ #
10
+ # A typical example:
11
+ #
12
+ # let(:facts) do
13
+ # override_facts(super(), os: {'selinux' => {'enabled' => false}})
14
+ # end
15
+ def override_facts(base_facts, **overrides)
16
+ facts = Marshal.load(Marshal.dump(base_facts))
17
+ apply_overrides!(facts, overrides, false)
18
+ facts
19
+ end
20
+
21
+ # A private helper to override_facts
22
+ def apply_overrides!(facts, overrides, enforce_strings)
23
+ overrides.each do |key, value|
24
+ # Nested facts are strings
25
+ key = key.to_s if enforce_strings
26
+
27
+ if value.is_a?(Hash)
28
+ facts[key] = {} unless facts.key?(key)
29
+ apply_overrides!(facts[key], value, true)
30
+ else
31
+ facts[key] = value
32
+ end
33
+ end
34
+ end
@@ -24,6 +24,7 @@ RSpec.configure do |config|
24
24
  end
25
25
  end
26
26
 
27
+ require 'voxpupuli/test/facts'
27
28
  require 'puppetlabs_spec_helper/module_spec_helper'
28
29
  require 'rspec-puppet-facts'
29
30
  include RspecPuppetFacts
@@ -0,0 +1,552 @@
1
+ # This is a shared config for easy consumption in other modules, without having
2
+ # to sync over a large file
3
+ require: rubocop-rspec
4
+
5
+ AllCops:
6
+ # Puppet Server 5 defaults to jruby 1.7 so TargetRubyVersion must stay at 1.9 until we drop support for puppet 5
7
+ TargetRubyVersion: 1.9
8
+ Include:
9
+ - ./**/*.rb
10
+ Exclude:
11
+ - files/**/*
12
+ - vendor/**/*
13
+ - .vendor/**/*
14
+ - pkg/**/*
15
+ - spec/fixtures/**/*
16
+ - Gemfile
17
+ - Rakefile
18
+ - Guardfile
19
+ - Vagrantfile
20
+
21
+ Lint/ConditionPosition:
22
+ Enabled: True
23
+
24
+ Lint/ElseLayout:
25
+ Enabled: True
26
+
27
+ Lint/UnreachableCode:
28
+ Enabled: True
29
+
30
+ Lint/UselessComparison:
31
+ Enabled: True
32
+
33
+ Lint/EnsureReturn:
34
+ Enabled: True
35
+
36
+ Lint/HandleExceptions:
37
+ Enabled: True
38
+
39
+ Lint/LiteralInCondition:
40
+ Enabled: True
41
+
42
+ Lint/ShadowingOuterLocalVariable:
43
+ Enabled: True
44
+
45
+ Lint/LiteralInInterpolation:
46
+ Enabled: True
47
+
48
+ Style/HashSyntax:
49
+ Enabled: True
50
+
51
+ Style/RedundantReturn:
52
+ Enabled: True
53
+
54
+ Layout/EndOfLine:
55
+ Enabled: False
56
+
57
+ Lint/AmbiguousOperator:
58
+ Enabled: True
59
+
60
+ Lint/AssignmentInCondition:
61
+ Enabled: True
62
+
63
+ Layout/SpaceBeforeComment:
64
+ Enabled: True
65
+
66
+ Style/AndOr:
67
+ Enabled: True
68
+
69
+ Style/RedundantSelf:
70
+ Enabled: True
71
+
72
+ Metrics/BlockLength:
73
+ Enabled: False
74
+
75
+ # Method length is not necessarily an indicator of code quality
76
+ Metrics/MethodLength:
77
+ Enabled: False
78
+
79
+ # Module length is not necessarily an indicator of code quality
80
+ Metrics/ModuleLength:
81
+ Enabled: False
82
+
83
+ Style/WhileUntilModifier:
84
+ Enabled: True
85
+
86
+ Lint/AmbiguousRegexpLiteral:
87
+ Enabled: True
88
+
89
+ Security/Eval:
90
+ Enabled: True
91
+
92
+ Lint/BlockAlignment:
93
+ Enabled: True
94
+
95
+ Lint/DefEndAlignment:
96
+ Enabled: True
97
+
98
+ Lint/EndAlignment:
99
+ Enabled: True
100
+
101
+ Lint/DeprecatedClassMethods:
102
+ Enabled: True
103
+
104
+ Lint/Loop:
105
+ Enabled: True
106
+
107
+ Lint/ParenthesesAsGroupedExpression:
108
+ Enabled: True
109
+
110
+ Lint/RescueException:
111
+ Enabled: True
112
+
113
+ Lint/StringConversionInInterpolation:
114
+ Enabled: True
115
+
116
+ Lint/UnusedBlockArgument:
117
+ Enabled: True
118
+
119
+ Lint/UnusedMethodArgument:
120
+ Enabled: True
121
+
122
+ Lint/UselessAccessModifier:
123
+ Enabled: True
124
+
125
+ Lint/UselessAssignment:
126
+ Enabled: True
127
+
128
+ Lint/Void:
129
+ Enabled: True
130
+
131
+ Layout/AccessModifierIndentation:
132
+ Enabled: True
133
+
134
+ Style/AccessorMethodName:
135
+ Enabled: True
136
+
137
+ Style/Alias:
138
+ Enabled: True
139
+
140
+ Layout/AlignArray:
141
+ Enabled: True
142
+
143
+ Layout/AlignHash:
144
+ Enabled: True
145
+
146
+ Layout/AlignParameters:
147
+ Enabled: True
148
+
149
+ Metrics/BlockNesting:
150
+ Enabled: True
151
+
152
+ Style/AsciiComments:
153
+ Enabled: True
154
+
155
+ Style/Attr:
156
+ Enabled: True
157
+
158
+ Style/BracesAroundHashParameters:
159
+ Enabled: False
160
+
161
+ Style/CaseEquality:
162
+ Enabled: True
163
+
164
+ Layout/CaseIndentation:
165
+ Enabled: True
166
+
167
+ Style/CharacterLiteral:
168
+ Enabled: True
169
+
170
+ Style/ClassAndModuleCamelCase:
171
+ Enabled: True
172
+
173
+ Style/ClassAndModuleChildren:
174
+ Enabled: False
175
+
176
+ Style/ClassCheck:
177
+ Enabled: True
178
+
179
+ # Class length is not necessarily an indicator of code quality
180
+ Metrics/ClassLength:
181
+ Enabled: False
182
+
183
+ Style/ClassMethods:
184
+ Enabled: True
185
+
186
+ Style/ClassVars:
187
+ Enabled: True
188
+
189
+ Style/WhenThen:
190
+ Enabled: True
191
+
192
+ Style/WordArray:
193
+ Enabled: True
194
+
195
+ Style/UnneededPercentQ:
196
+ Enabled: True
197
+
198
+ Layout/Tab:
199
+ Enabled: True
200
+
201
+ Layout/SpaceBeforeSemicolon:
202
+ Enabled: True
203
+
204
+ Layout/TrailingBlankLines:
205
+ Enabled: True
206
+
207
+ Layout/SpaceInsideBlockBraces:
208
+ Enabled: True
209
+
210
+ Layout/SpaceInsideBrackets:
211
+ Enabled: True
212
+
213
+ Layout/SpaceInsideHashLiteralBraces:
214
+ Enabled: True
215
+
216
+ Layout/SpaceInsideParens:
217
+ Enabled: True
218
+
219
+ Layout/LeadingCommentSpace:
220
+ Enabled: True
221
+
222
+ Layout/SpaceBeforeFirstArg:
223
+ Enabled: True
224
+
225
+ Layout/SpaceAfterColon:
226
+ Enabled: True
227
+
228
+ Layout/SpaceAfterComma:
229
+ Enabled: True
230
+
231
+ Layout/SpaceAfterMethodName:
232
+ Enabled: True
233
+
234
+ Layout/SpaceAfterNot:
235
+ Enabled: True
236
+
237
+ Layout/SpaceAfterSemicolon:
238
+ Enabled: True
239
+
240
+ Layout/SpaceAroundEqualsInParameterDefault:
241
+ Enabled: True
242
+
243
+ Layout/SpaceAroundOperators:
244
+ Enabled: True
245
+
246
+ Layout/SpaceBeforeBlockBraces:
247
+ Enabled: True
248
+
249
+ Layout/SpaceBeforeComma:
250
+ Enabled: True
251
+
252
+ Style/CollectionMethods:
253
+ Enabled: True
254
+
255
+ Layout/CommentIndentation:
256
+ Enabled: True
257
+
258
+ Style/ColonMethodCall:
259
+ Enabled: True
260
+
261
+ Style/CommentAnnotation:
262
+ Enabled: True
263
+
264
+ # 'Complexity' is very relative
265
+ Metrics/CyclomaticComplexity:
266
+ Enabled: False
267
+
268
+ Style/ConstantName:
269
+ Enabled: True
270
+
271
+ Style/Documentation:
272
+ Enabled: False
273
+
274
+ Style/DefWithParentheses:
275
+ Enabled: True
276
+
277
+ Style/PreferredHashMethods:
278
+ Enabled: True
279
+
280
+ Layout/DotPosition:
281
+ EnforcedStyle: trailing
282
+
283
+ Style/DoubleNegation:
284
+ Enabled: True
285
+
286
+ Style/EachWithObject:
287
+ Enabled: True
288
+
289
+ Layout/EmptyLineBetweenDefs:
290
+ Enabled: True
291
+
292
+ Layout/IndentArray:
293
+ Enabled: True
294
+
295
+ Layout/IndentHash:
296
+ Enabled: True
297
+
298
+ Layout/IndentationConsistency:
299
+ Enabled: True
300
+
301
+ Layout/IndentationWidth:
302
+ Enabled: True
303
+
304
+ Layout/EmptyLines:
305
+ Enabled: True
306
+
307
+ Layout/EmptyLinesAroundAccessModifier:
308
+ Enabled: True
309
+
310
+ Style/EmptyLiteral:
311
+ Enabled: True
312
+
313
+ # Configuration parameters: AllowURI, URISchemes.
314
+ Metrics/LineLength:
315
+ Enabled: False
316
+
317
+ Style/MethodCallWithoutArgsParentheses:
318
+ Enabled: True
319
+
320
+ Style/MethodDefParentheses:
321
+ Enabled: True
322
+
323
+ Style/LineEndConcatenation:
324
+ Enabled: True
325
+
326
+ Layout/TrailingWhitespace:
327
+ Enabled: True
328
+
329
+ Style/StringLiterals:
330
+ Enabled: True
331
+
332
+ Style/TrailingCommaInArguments:
333
+ Enabled: True
334
+
335
+ Style/TrailingCommaInLiteral:
336
+ Enabled: True
337
+
338
+ Style/GlobalVars:
339
+ Enabled: True
340
+
341
+ Style/GuardClause:
342
+ Enabled: True
343
+
344
+ Style/IfUnlessModifier:
345
+ Enabled: True
346
+
347
+ Style/MultilineIfThen:
348
+ Enabled: True
349
+
350
+ Style/NegatedIf:
351
+ Enabled: True
352
+
353
+ Style/NegatedWhile:
354
+ Enabled: True
355
+
356
+ Style/Next:
357
+ Enabled: True
358
+
359
+ Style/SingleLineBlockParams:
360
+ Enabled: True
361
+
362
+ Style/SingleLineMethods:
363
+ Enabled: True
364
+
365
+ Style/SpecialGlobalVars:
366
+ Enabled: True
367
+
368
+ Style/TrivialAccessors:
369
+ Enabled: True
370
+
371
+ Style/UnlessElse:
372
+ Enabled: True
373
+
374
+ Style/VariableInterpolation:
375
+ Enabled: True
376
+
377
+ Style/VariableName:
378
+ Enabled: True
379
+
380
+ Style/WhileUntilDo:
381
+ Enabled: True
382
+
383
+ Style/EvenOdd:
384
+ Enabled: True
385
+
386
+ Style/FileName:
387
+ Enabled: True
388
+
389
+ Style/For:
390
+ Enabled: True
391
+
392
+ Style/Lambda:
393
+ Enabled: True
394
+
395
+ Style/MethodName:
396
+ Enabled: True
397
+
398
+ Style/MultilineTernaryOperator:
399
+ Enabled: True
400
+
401
+ Style/NestedTernaryOperator:
402
+ Enabled: True
403
+
404
+ Style/NilComparison:
405
+ Enabled: True
406
+
407
+ Style/FormatString:
408
+ Enabled: True
409
+
410
+ Style/MultilineBlockChain:
411
+ Enabled: True
412
+
413
+ Style/Semicolon:
414
+ Enabled: True
415
+
416
+ Style/SignalException:
417
+ Enabled: True
418
+
419
+ Style/NonNilCheck:
420
+ Enabled: True
421
+
422
+ Style/Not:
423
+ Enabled: True
424
+
425
+ Style/NumericLiterals:
426
+ Enabled: True
427
+
428
+ Style/OneLineConditional:
429
+ Enabled: True
430
+
431
+ Style/OpMethod:
432
+ Enabled: True
433
+
434
+ Style/ParenthesesAroundCondition:
435
+ Enabled: True
436
+
437
+ Style/PercentLiteralDelimiters:
438
+ Enabled: True
439
+
440
+ Style/PerlBackrefs:
441
+ Enabled: True
442
+
443
+ Style/PredicateName:
444
+ Enabled: True
445
+
446
+ Style/RedundantException:
447
+ Enabled: True
448
+
449
+ Style/SelfAssignment:
450
+ Enabled: True
451
+
452
+ Style/Proc:
453
+ Enabled: True
454
+
455
+ Style/RaiseArgs:
456
+ Enabled: True
457
+
458
+ Style/RedundantBegin:
459
+ Enabled: True
460
+
461
+ Style/RescueModifier:
462
+ Enabled: True
463
+
464
+ # based on https://github.com/voxpupuli/modulesync_config/issues/168
465
+ Style/RegexpLiteral:
466
+ EnforcedStyle: percent_r
467
+ Enabled: True
468
+
469
+ Lint/UnderscorePrefixedVariableName:
470
+ Enabled: True
471
+
472
+ Metrics/ParameterLists:
473
+ Enabled: False
474
+
475
+ Lint/RequireParentheses:
476
+ Enabled: True
477
+
478
+ Style/ModuleFunction:
479
+ Enabled: True
480
+
481
+ Lint/Debugger:
482
+ Enabled: True
483
+
484
+ Style/IfWithSemicolon:
485
+ Enabled: True
486
+
487
+ Style/Encoding:
488
+ Enabled: True
489
+
490
+ Style/BlockDelimiters:
491
+ Enabled: True
492
+
493
+ Layout/MultilineBlockLayout:
494
+ Enabled: True
495
+
496
+ # 'Complexity' is very relative
497
+ Metrics/AbcSize:
498
+ Enabled: False
499
+
500
+ # 'Complexity' is very relative
501
+ Metrics/PerceivedComplexity:
502
+ Enabled: False
503
+
504
+ Lint/UselessAssignment:
505
+ Enabled: True
506
+
507
+ Layout/ClosingParenthesisIndentation:
508
+ Enabled: True
509
+
510
+ # RSpec
511
+
512
+ RSpec/BeforeAfterAll:
513
+ Exclude:
514
+ - spec/acceptance/**/*
515
+
516
+ # We don't use rspec in this way
517
+ RSpec/DescribeClass:
518
+ Enabled: False
519
+
520
+ # Example length is not necessarily an indicator of code quality
521
+ RSpec/ExampleLength:
522
+ Enabled: False
523
+
524
+ RSpec/NamedSubject:
525
+ Enabled: False
526
+
527
+ # disabled for now since they cause a lot of issues
528
+ # these issues aren't easy to fix
529
+ RSpec/RepeatedDescription:
530
+ Enabled: False
531
+
532
+ RSpec/NestedGroups:
533
+ Enabled: False
534
+
535
+ RSpec/MultipleExpectations:
536
+ Enabled: false
537
+
538
+ # this is broken on ruby1.9
539
+ Layout/IndentHeredoc:
540
+ Enabled: False
541
+
542
+ Security/YAMLLoad:
543
+ Enabled: True
544
+
545
+ # This affects hiera interpolation, as well as some configs that we push.
546
+ Style/FormatStringToken:
547
+ Enabled: false
548
+
549
+ # This is useful, but sometimes a little too picky about where unit tests files
550
+ # are located.
551
+ RSpec/FilePath:
552
+ Enabled: false
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: voxpupuli-test
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vox Pupuli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-14 00:00:00.000000000 Z
11
+ date: 2020-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: facterdb
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 1.4.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 1.4.0
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: metadata-json-lint
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -112,16 +126,16 @@ dependencies:
112
126
  name: rubocop-rspec
113
127
  requirement: !ruby/object:Gem::Requirement
114
128
  requirements:
115
- - - '='
129
+ - - "~>"
116
130
  - !ruby/object:Gem::Version
117
- version: 1.15.0
131
+ version: 1.16.0
118
132
  type: :runtime
119
133
  prerelease: false
120
134
  version_requirements: !ruby/object:Gem::Requirement
121
135
  requirements:
122
- - - '='
136
+ - - "~>"
123
137
  - !ruby/object:Gem::Version
124
- version: 1.15.0
138
+ version: 1.16.0
125
139
  - !ruby/object:Gem::Dependency
126
140
  name: puppet-lint-absolute_classname-check
127
141
  requirement: !ruby/object:Gem::Requirement
@@ -276,6 +290,62 @@ dependencies:
276
290
  - - ">="
277
291
  - !ruby/object:Gem::Version
278
292
  version: '0'
293
+ - !ruby/object:Gem::Dependency
294
+ name: puppet-lint-manifest_whitespace-check
295
+ requirement: !ruby/object:Gem::Requirement
296
+ requirements:
297
+ - - ">="
298
+ - !ruby/object:Gem::Version
299
+ version: '0'
300
+ type: :runtime
301
+ prerelease: false
302
+ version_requirements: !ruby/object:Gem::Requirement
303
+ requirements:
304
+ - - ">="
305
+ - !ruby/object:Gem::Version
306
+ version: '0'
307
+ - !ruby/object:Gem::Dependency
308
+ name: puppet-lint-file_ensure-check
309
+ requirement: !ruby/object:Gem::Requirement
310
+ requirements:
311
+ - - ">="
312
+ - !ruby/object:Gem::Version
313
+ version: '0'
314
+ type: :runtime
315
+ prerelease: false
316
+ version_requirements: !ruby/object:Gem::Requirement
317
+ requirements:
318
+ - - ">="
319
+ - !ruby/object:Gem::Version
320
+ version: '0'
321
+ - !ruby/object:Gem::Dependency
322
+ name: puppet-lint-strict_indent-check
323
+ requirement: !ruby/object:Gem::Requirement
324
+ requirements:
325
+ - - ">="
326
+ - !ruby/object:Gem::Version
327
+ version: '0'
328
+ type: :runtime
329
+ prerelease: false
330
+ version_requirements: !ruby/object:Gem::Requirement
331
+ requirements:
332
+ - - ">="
333
+ - !ruby/object:Gem::Version
334
+ version: '0'
335
+ - !ruby/object:Gem::Dependency
336
+ name: rspec
337
+ requirement: !ruby/object:Gem::Requirement
338
+ requirements:
339
+ - - ">="
340
+ - !ruby/object:Gem::Version
341
+ version: '0'
342
+ type: :development
343
+ prerelease: false
344
+ version_requirements: !ruby/object:Gem::Requirement
345
+ requirements:
346
+ - - ">="
347
+ - !ruby/object:Gem::Version
348
+ version: '0'
279
349
  description: A package that depends on all the gems Vox Pupuli modules need and methods
280
350
  to simplify spec helpers
281
351
  email:
@@ -285,8 +355,10 @@ extensions: []
285
355
  extra_rdoc_files: []
286
356
  files:
287
357
  - lib/voxpupuli/test.rb
358
+ - lib/voxpupuli/test/facts.rb
288
359
  - lib/voxpupuli/test/rake.rb
289
360
  - lib/voxpupuli/test/spec_helper.rb
361
+ - rubocop.yml
290
362
  homepage: http://github.com/voxpupuli/voxpupuli-test
291
363
  licenses:
292
364
  - Apache-2.0