puppetlabs_spec_helper 5.0.3 → 6.0.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: '0463812df931c62b101e5dd8711923e5787b75710b75a9cd22e965db859f7ca4'
4
- data.tar.gz: 1fed48c27d1f6e64a37d127866158933b8188eb09241d66c2587e54b7ff3e358
3
+ metadata.gz: be54cffdbba3df2bbc1d420a022b8c09944157f8d28eea1d4c287e117516595d
4
+ data.tar.gz: 4770d483808a9e6c380fb2ea6dc6bfb99730916ae1430fb4579a80a8421f51e7
5
5
  SHA512:
6
- metadata.gz: 6932eaa811fabd5fbd61b0447719f0dc51f1f69cd62e336f63dedf35c8fab6ee29bbb5fc004c65602edac33dab2e207bc08dbd56546dcdfefd18c52e1b95138c
7
- data.tar.gz: c187e3756855b13ee5098505f892c143cfbd13d3301c50bea80ad52dd4a9e5f8419786a579da02dd15ba1ba5df2bd353ce6fc5906f2d402097a167c6331f7f8f
6
+ metadata.gz: ea49b0a799ea3d8f8561f186705e4dcfe18b39b46abe60c082cd78ec5349e183ae4b19958d23be696edb0962c094f79b0cb5763d534e64c3d3a22633a617b76e
7
+ data.tar.gz: 34c2e4d8389a653e0c6b5e4ce07f78c84e8dd01d7acdb3d05a1ef0a5f20d3847c004c27d9594f8fc66c3121af69710598b6ef6e8fcded48c04db67d65b22e3c7
data/.rubocop.yml CHANGED
@@ -1,517 +1,19 @@
1
- ---
1
+ inherit_from: .rubocop_todo.yml
2
+
2
3
  require:
3
- - rubocop-performance
4
- - rubocop-rspec
4
+ - rubocop-performance
5
+ - rubocop-rspec
6
+
5
7
  AllCops:
6
- DisplayCopNames: true
8
+ Exclude:
9
+ - Gemfile
10
+ - Rakefile
11
+ - spec/fixtures/**/*
12
+ - vendor/bundle/**/*
13
+ NewCops: enable
7
14
  SuggestExtensions: false
8
15
  TargetRubyVersion: '2.7'
9
- Include:
10
- - "**/*.rb"
11
- Exclude:
12
- - bin/*
13
- - ".vendor/**/*"
14
- - "**/Gemfile"
15
- - "**/Rakefile"
16
- - pkg/**/*
17
- - spec/fixtures/**/*
18
- - vendor/**/*
19
- - "**/Puppetfile"
20
- - "**/Vagrantfile"
21
- - "**/Guardfile"
22
- - '**/*.erb'
23
- - 'lib/puppet-strings/yard/templates/**/*'
24
- Layout/LineLength:
25
- Description: People have wide screens, use them.
26
- Max: 200
27
- RSpec/BeforeAfterAll:
28
- Description: Beware of using after(:all) as it may cause state to leak between tests.
29
- A necessary evil in acceptance testing.
30
- Exclude:
31
- - spec/acceptance/**/*.rb
32
- RSpec/HookArgument:
33
- Description: Prefer explicit :each argument, matching existing module's style
34
- EnforcedStyle: each
35
- Style/BlockDelimiters:
36
- Description: Prefer braces for chaining. Mostly an aesthetical choice. Better to
37
- be consistent then.
38
- EnforcedStyle: braces_for_chaining
39
- Style/EmptyElse:
40
- Description: Enforce against empty else clauses, but allow `nil` for clarity.
41
- EnforcedStyle: empty
42
- Style/FormatString:
43
- Description: Following the main puppet project's style, prefer the % format format.
44
- EnforcedStyle: percent
45
- Style/FormatStringToken:
46
- Description: Following the main puppet project's style, prefer the simpler template
47
- tokens over annotated ones.
48
- EnforcedStyle: template
49
- Style/Lambda:
50
- Description: Prefer the keyword for easier discoverability.
51
- EnforcedStyle: literal
52
- Style/RegexpLiteral:
53
- Description: Community preference. See https://github.com/voxpupuli/modulesync_config/issues/168
54
- EnforcedStyle: percent_r
55
- Style/TernaryParentheses:
56
- Description: Checks for use of parentheses around ternary conditions. Enforce parentheses
57
- on complex expressions for better readability, but seriously consider breaking
58
- it up.
59
- EnforcedStyle: require_parentheses_when_complex
60
- Style/TrailingCommaInArguments:
61
- Description: Prefer always trailing comma on multiline argument lists. This makes
62
- diffs, and re-ordering nicer.
63
- EnforcedStyleForMultiline: comma
64
- Style/TrailingCommaInArrayLiteral:
65
- Description: Prefer always trailing comma on multiline literals. This makes diffs,
66
- and re-ordering nicer.
67
- EnforcedStyleForMultiline: comma
68
- Style/SymbolArray:
69
- Description: Using percent style obscures symbolic intent of array's contents.
70
- EnforcedStyle: brackets
71
- RSpec/MessageSpies:
72
- EnforcedStyle: receive
73
- Style/Documentation:
74
- Exclude:
75
- - spec/**/*
76
- Style/WordArray:
77
- EnforcedStyle: brackets
78
- Performance/AncestorsInclude:
79
- Enabled: true
80
- Performance/BigDecimalWithNumericArgument:
81
- Enabled: true
82
- Performance/BlockGivenWithExplicitBlock:
83
- Enabled: true
84
- Performance/CaseWhenSplat:
85
- Enabled: true
86
- Performance/ConstantRegexp:
87
- Enabled: true
88
- Performance/MethodObjectAsBlock:
89
- Enabled: true
90
- Performance/RedundantSortBlock:
91
- Enabled: true
92
- Performance/RedundantStringChars:
93
- Enabled: true
94
- Performance/ReverseFirst:
95
- Enabled: true
96
- Performance/SortReverse:
97
- Enabled: true
98
- Performance/Squeeze:
99
- Enabled: true
100
- Performance/StringInclude:
101
- Enabled: true
102
- Performance/Sum:
103
- Enabled: true
104
- Style/CollectionMethods:
105
- Enabled: true
106
- Style/MethodCalledOnDoEndBlock:
107
- Enabled: true
108
- Style/StringMethods:
109
- Enabled: true
110
- Bundler/InsecureProtocolSource:
111
- Enabled: false
112
- Gemspec/DuplicatedAssignment:
113
- Enabled: false
114
- Gemspec/OrderedDependencies:
115
- Enabled: false
116
- Gemspec/RequiredRubyVersion:
117
- Enabled: false
118
- Gemspec/RubyVersionGlobalsUsage:
119
- Enabled: false
120
- Layout/ArgumentAlignment:
121
- Enabled: false
122
- Layout/BeginEndAlignment:
123
- Enabled: false
124
- Layout/ClosingHeredocIndentation:
125
- Enabled: true
126
- Layout/EmptyComment:
127
- Enabled: false
128
- Layout/EmptyLineAfterGuardClause:
129
- Enabled: false
130
- Layout/EmptyLinesAroundArguments:
131
- Enabled: false
132
- Layout/EmptyLinesAroundAttributeAccessor:
133
- Enabled: false
134
- Layout/EndOfLine:
135
- Enabled: false
136
- Layout/FirstArgumentIndentation:
137
- Enabled: false
138
- Layout/HashAlignment:
139
- Enabled: false
140
- Layout/HeredocIndentation:
141
- Enabled: true
142
- Layout/LeadingEmptyLines:
143
- Enabled: false
144
- Layout/SpaceAroundMethodCallOperator:
145
- Enabled: false
146
- Layout/SpaceInsideArrayLiteralBrackets:
147
- Enabled: false
148
- Layout/SpaceInsideReferenceBrackets:
149
- Enabled: false
150
- Lint/BigDecimalNew:
151
- Enabled: false
152
- Lint/BooleanSymbol:
153
- Enabled: false
154
- Lint/ConstantDefinitionInBlock:
155
- Enabled: false
156
- Lint/DeprecatedOpenSSLConstant:
157
- Enabled: false
158
- Lint/DisjunctiveAssignmentInConstructor:
159
- Enabled: false
160
- Lint/DuplicateElsifCondition:
161
- Enabled: false
162
- Lint/DuplicateRequire:
163
- Enabled: false
164
- Lint/DuplicateRescueException:
165
- Enabled: false
166
- Lint/EmptyConditionalBody:
167
- Enabled: false
168
- Lint/EmptyFile:
169
- Enabled: false
170
- Lint/ErbNewArguments:
171
- Enabled: false
172
- Lint/FloatComparison:
173
- Enabled: false
174
- Lint/HashCompareByIdentity:
175
- Enabled: false
176
- Lint/IdentityComparison:
177
- Enabled: false
178
- Lint/InterpolationCheck:
179
- Enabled: false
180
- Lint/MissingCopEnableDirective:
181
- Enabled: false
182
- Lint/MixedRegexpCaptureTypes:
183
- Enabled: false
184
- Lint/NestedPercentLiteral:
185
- Enabled: false
186
- Lint/NonDeterministicRequireOrder:
187
- Enabled: false
188
- Lint/OrderedMagicComments:
189
- Enabled: false
190
- Lint/OutOfRangeRegexpRef:
191
- Enabled: false
192
- Lint/RaiseException:
193
- Enabled: false
194
- Lint/RedundantCopEnableDirective:
195
- Enabled: false
196
- Lint/RedundantRequireStatement:
197
- Enabled: false
198
- Lint/RedundantSafeNavigation:
199
- Enabled: false
200
- Lint/RedundantWithIndex:
201
- Enabled: false
202
- Lint/RedundantWithObject:
203
- Enabled: false
204
- Lint/RegexpAsCondition:
205
- Enabled: false
206
- Lint/ReturnInVoidContext:
207
- Enabled: false
208
- Lint/SafeNavigationConsistency:
209
- Enabled: false
210
- Lint/SafeNavigationWithEmpty:
211
- Enabled: false
212
- Lint/SelfAssignment:
213
- Enabled: false
214
- Lint/SendWithMixinArgument:
215
- Enabled: false
216
- Lint/ShadowedArgument:
217
- Enabled: false
218
- Lint/StructNewOverride:
219
- Enabled: false
220
- Lint/ToJSON:
221
- Enabled: false
222
- Lint/TopLevelReturnWithArgument:
223
- Enabled: false
224
- Lint/TrailingCommaInAttributeDeclaration:
225
- Enabled: false
226
- Lint/UnreachableLoop:
227
- Enabled: false
228
- Lint/UriEscapeUnescape:
229
- Enabled: false
230
- Lint/UriRegexp:
231
- Enabled: false
232
- Lint/UselessMethodDefinition:
233
- Enabled: false
234
- Lint/UselessTimes:
235
- Enabled: false
236
- Metrics/AbcSize:
237
- Enabled: false
238
- Metrics/BlockLength:
239
- Enabled: false
240
- Metrics/BlockNesting:
241
- Enabled: false
242
- Metrics/ClassLength:
243
- Enabled: false
244
- Metrics/CyclomaticComplexity:
245
- Enabled: false
246
- Metrics/MethodLength:
247
- Enabled: false
248
- Metrics/ModuleLength:
249
- Enabled: false
250
- Metrics/ParameterLists:
251
- Enabled: false
252
- Metrics/PerceivedComplexity:
253
- Enabled: false
254
- Migration/DepartmentName:
255
- Enabled: false
256
- Naming/AccessorMethodName:
257
- Enabled: false
258
- Naming/BlockParameterName:
259
- Enabled: false
260
- Naming/HeredocDelimiterCase:
261
- Enabled: false
262
- Naming/HeredocDelimiterNaming:
263
- Enabled: false
264
- Naming/MemoizedInstanceVariableName:
265
- Enabled: false
266
- Naming/MethodParameterName:
267
- Enabled: false
268
- Naming/RescuedExceptionsVariableName:
269
- Enabled: false
270
- Naming/VariableNumber:
271
- Enabled: false
272
- Performance/BindCall:
273
- Enabled: false
274
- Performance/DeletePrefix:
275
- Enabled: false
276
- Performance/DeleteSuffix:
277
- Enabled: false
278
- Performance/InefficientHashSearch:
279
- Enabled: false
280
- Performance/UnfreezeString:
281
- Enabled: false
282
- Performance/UriDefaultParser:
283
- Enabled: false
284
- RSpec/Be:
285
- Enabled: false
286
- RSpec/Capybara/CurrentPathExpectation:
287
- Enabled: false
288
- RSpec/Capybara/FeatureMethods:
289
- Enabled: false
290
- RSpec/Capybara/VisibilityMatcher:
291
- Enabled: false
292
- RSpec/ContextMethod:
293
- Enabled: false
294
- RSpec/ContextWording:
295
- Enabled: false
296
- RSpec/DescribeClass:
297
- Enabled: false
298
- RSpec/EmptyHook:
299
- Enabled: false
300
- RSpec/EmptyLineAfterExample:
301
- Enabled: false
302
- RSpec/EmptyLineAfterExampleGroup:
303
- Enabled: false
304
- RSpec/EmptyLineAfterHook:
305
- Enabled: false
306
- RSpec/ExampleLength:
307
- Enabled: false
308
- RSpec/ExampleWithoutDescription:
309
- Enabled: false
310
- RSpec/ExpectChange:
311
- Enabled: false
312
- RSpec/ExpectInHook:
313
- Enabled: false
314
- RSpec/FactoryBot/AttributeDefinedStatically:
315
- Enabled: false
316
- RSpec/FactoryBot/CreateList:
317
- Enabled: false
318
- RSpec/FactoryBot/FactoryClassName:
319
- Enabled: false
320
- RSpec/FilePath:
321
- Enabled: false
322
- RSpec/HooksBeforeExamples:
323
- Enabled: false
324
- RSpec/ImplicitBlockExpectation:
325
- Enabled: false
326
- RSpec/ImplicitSubject:
327
- Enabled: false
328
- RSpec/LeakyConstantDeclaration:
329
- Enabled: false
330
- RSpec/LetBeforeExamples:
331
- Enabled: false
332
- RSpec/MissingExampleGroupArgument:
333
- Enabled: false
334
- RSpec/MultipleExpectations:
335
- Enabled: false
336
- RSpec/MultipleMemoizedHelpers:
337
- Enabled: false
338
- RSpec/MultipleSubjects:
339
- Enabled: false
340
- RSpec/NestedGroups:
341
- Enabled: false
342
- RSpec/PredicateMatcher:
343
- Enabled: false
344
- RSpec/ReceiveCounts:
345
- Enabled: false
346
- RSpec/ReceiveNever:
347
- Enabled: false
348
- RSpec/RepeatedExampleGroupBody:
349
- Enabled: false
350
- RSpec/RepeatedExampleGroupDescription:
351
- Enabled: false
352
- RSpec/RepeatedIncludeExample:
353
- Enabled: false
354
- RSpec/ReturnFromStub:
355
- Enabled: false
356
- RSpec/SharedExamples:
357
- Enabled: false
358
- RSpec/StubbedMock:
359
- Enabled: false
360
- RSpec/UnspecifiedException:
361
- Enabled: false
362
- RSpec/VariableDefinition:
363
- Enabled: false
364
- RSpec/VoidExpect:
365
- Enabled: false
366
- RSpec/Yield:
367
- Enabled: false
368
- Security/Open:
369
- Enabled: false
370
- Style/AccessModifierDeclarations:
371
- Enabled: false
372
- Style/AccessorGrouping:
373
- Enabled: false
374
- Style/AsciiComments:
375
- Enabled: false
376
- Style/BisectedAttrAccessor:
377
- Enabled: false
378
- Style/CaseLikeIf:
379
- Enabled: false
380
- Style/ClassEqualityComparison:
381
- Enabled: false
382
- Style/ColonMethodDefinition:
383
- Enabled: false
384
- Style/CombinableLoops:
385
- Enabled: false
386
- Style/CommentedKeyword:
387
- Enabled: false
388
- Style/Dir:
389
- Enabled: false
390
- Style/DoubleCopDisableDirective:
391
- Enabled: false
392
- Style/EmptyBlockParameter:
393
- Enabled: false
394
- Style/EmptyLambdaParameter:
395
- Enabled: false
396
- Style/Encoding:
397
- Enabled: false
398
- Style/EvalWithLocation:
399
- Enabled: false
400
- Style/ExpandPathArguments:
401
- Enabled: false
402
- Style/ExplicitBlockArgument:
403
- Enabled: false
404
- Style/ExponentialNotation:
405
- Enabled: false
406
- Style/FloatDivision:
407
- Enabled: false
408
- Style/FrozenStringLiteralComment:
409
- Enabled: false
410
- Style/GlobalStdStream:
411
- Enabled: false
412
- Style/HashAsLastArrayItem:
413
- Enabled: false
414
- Style/HashLikeCase:
415
- Enabled: false
416
- Style/HashTransformKeys:
417
- Enabled: false
418
- Style/HashTransformValues:
419
- Enabled: false
420
- Style/IfUnlessModifier:
421
- Enabled: false
422
- Style/KeywordParametersOrder:
423
- Enabled: false
424
- Style/MinMax:
425
- Enabled: false
426
- Style/MixinUsage:
427
- Enabled: false
428
- Style/MultilineWhenThen:
429
- Enabled: false
430
- Style/NegatedUnless:
431
- Enabled: false
432
- Style/NumericPredicate:
433
- Enabled: false
434
- Style/OptionalBooleanParameter:
435
- Enabled: false
436
- Style/OrAssignment:
437
- Enabled: false
438
- Style/RandomWithOffset:
439
- Enabled: false
440
- Style/RedundantAssignment:
441
- Enabled: false
442
- Style/RedundantCondition:
443
- Enabled: false
444
- Style/RedundantConditional:
445
- Enabled: false
446
- Style/RedundantFetchBlock:
447
- Enabled: false
448
- Style/RedundantFileExtensionInRequire:
449
- Enabled: false
450
- Style/RedundantRegexpCharacterClass:
451
- Enabled: false
452
- Style/RedundantRegexpEscape:
453
- Enabled: false
454
- Style/RedundantSelfAssignment:
455
- Enabled: false
456
- Style/RedundantSort:
457
- Enabled: false
458
- Style/RescueStandardError:
459
- Enabled: false
460
- Style/SingleArgumentDig:
461
- Enabled: false
462
- Style/SlicingWithRange:
463
- Enabled: false
464
- Style/SoleNestedConditional:
465
- Enabled: false
466
- Style/StderrPuts:
467
- Enabled: false
468
- Style/StringConcatenation:
469
- Enabled: false
470
- Style/Strip:
471
- Enabled: false
472
- Style/SymbolProc:
473
- Enabled: false
474
- Style/TrailingBodyOnClass:
475
- Enabled: false
476
- Style/TrailingBodyOnMethodDefinition:
477
- Enabled: false
478
- Style/TrailingBodyOnModule:
479
- Enabled: false
480
- Style/TrailingCommaInHashLiteral:
481
- Enabled: false
482
- Style/TrailingMethodEndStatement:
483
- Enabled: false
484
- Style/UnpackFirst:
485
- Enabled: false
486
- Lint/DuplicateBranch:
487
- Enabled: false
488
- Lint/DuplicateRegexpCharacterClassElement:
489
- Enabled: false
490
- Lint/EmptyBlock:
491
- Enabled: false
492
- Lint/EmptyClass:
493
- Enabled: false
494
- Lint/NoReturnInBeginEndBlocks:
495
- Enabled: false
496
- Lint/ToEnumArguments:
497
- Enabled: false
498
- Lint/UnexpectedBlockArity:
499
- Enabled: false
500
- Lint/UnmodifiedReduceAccumulator:
501
- Enabled: false
502
- Performance/CollectionLiteralInLoop:
503
- Enabled: false
504
- Style/ArgumentsForwarding:
505
- Enabled: false
506
- Style/CollectionCompact:
507
- Enabled: false
508
- Style/DocumentDynamicEvalDefinition:
509
- Enabled: false
510
- Style/NegatedIfElseCondition:
511
- Enabled: false
512
- Style/NilLambda:
513
- Enabled: false
514
- Style/RedundantArgument:
515
- Enabled: false
516
- Style/SwapValues:
16
+
17
+ # Disabled
18
+ Style/ClassAndModuleChildren:
517
19
  Enabled: false
data/README.md CHANGED
@@ -49,7 +49,7 @@ Fixture downloads will now execute in parallel to speed up the testing process.
49
49
  to a positive integer, the default is currently 10. We don't suggest going higher than 25 as the gains are marginal due to some repos taking a long time to download. Please be aware that your internal VCS system may not be able to handle a high load in which case the server would fail to clone the repository. Because of this issue, this setting is tunable via `MAX_FIXTURE_THREAD_COUNT`.
50
50
 
51
51
  Additionally, you can also speed up cloning when using the ssh protocol by multiplexing ssh sessions. Add something similar to your ssh config.
52
- Note: you may need to change the host if your using an internal git server.
52
+ Note: you may need to change the host if you're using an internal git server.
53
53
 
54
54
  ```shell
55
55
  Host github.com
@@ -257,7 +257,7 @@ fixtures:
257
257
  ref: "2.6.0"
258
258
  ```
259
259
 
260
- Only install the `yumrepo_core` module when testing against Puppet 6 or greater:
260
+ Only install the `yumrepo_core` module when testing against Puppet 7 or greater:
261
261
 
262
262
  ```yaml
263
263
  fixtures:
@@ -16,7 +16,7 @@ end
16
16
  spec_path = File.expand_path(File.join(Dir.pwd, 'spec'))
17
17
  fixture_path = File.join(spec_path, 'fixtures')
18
18
 
19
- env_module_path = ENV['MODULEPATH']
19
+ 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
@@ -29,7 +29,7 @@ if ENV['SIMPLECOV'] == 'yes'
29
29
  SimpleCov.formatters = [
30
30
  SimpleCov::Formatter::HTMLFormatter,
31
31
  SimpleCov::Formatter::Console,
32
- SimpleCov::Formatter::Codecov,
32
+ SimpleCov::Formatter::Codecov
33
33
  ]
34
34
  SimpleCov.start do
35
35
  track_files 'lib/**/*.rb'
@@ -55,29 +55,30 @@ end
55
55
  # Add all spec lib dirs to LOAD_PATH
56
56
  components = module_path.split(File::PATH_SEPARATOR).map do |dir|
57
57
  next unless Dir.exist? dir
58
- Dir.entries(dir).reject { |f| f =~ %r{^\.} }.map { |f| File.join(dir, f, 'spec', 'lib') }
58
+
59
+ Dir.entries(dir).grep_v(/^\./).map { |f| File.join(dir, f, 'spec', 'lib') }
59
60
  end
60
61
  components.flatten.each do |d|
61
62
  $LOAD_PATH << d if FileTest.directory?(d) && !$LOAD_PATH.include?(d)
62
63
  end
63
64
 
64
65
  RSpec.configure do |c|
65
- if ENV['GITHUB_ACTIONS'] == 'true'
66
- c.formatter = 'RSpec::Github::Formatter'
67
- end
66
+ c.formatter = 'RSpec::Github::Formatter' if ENV['GITHUB_ACTIONS'] == 'true'
68
67
 
69
68
  c.environmentpath = spec_path
70
69
  c.module_path = module_path
71
70
  c.manifest_dir = File.join(fixture_path, 'manifests')
72
71
 
72
+ # https://github.com/puppetlabs/rspec-puppet#strict_variables
73
+ c.strict_variables = ENV['STRICT_VARIABLES'] != 'no'
74
+ # https://github.com/puppetlabs/rspec-puppet#ordering
75
+ c.ordering = ENV['ORDERING'] if ENV['ORDERING']
76
+
73
77
  c.before :each do
74
78
  if c.mock_framework.framework_name == :rspec
75
79
  allow(Puppet.features).to receive(:root?).and_return(true)
76
80
  else
77
81
  Puppet.features.stubs(:root?).returns(true)
78
82
  end
79
-
80
- Puppet.settings[:strict_variables] = true if ENV['STRICT_VARIABLES'] == 'yes' || ENV['STRICT_VARIABLES'] != 'no'
81
- Puppet.settings[:ordering] = ENV['ORDERING'] if ENV['ORDERING']
82
83
  end
83
84
  end
@@ -57,9 +57,7 @@ RSpec.configure do |config|
57
57
  # @mock_framework is used since more than seven years, and we need to avoid
58
58
  # `mock_framework`'s autoloading to distinguish between the default, and
59
59
  # the module's choice.
60
- if config.instance_variable_get(:@mock_framework).nil?
61
- config.mock_with :rspec
62
- end
60
+ config.mock_with :rspec if config.instance_variable_get(:@mock_framework).nil?
63
61
 
64
62
  # Here we do some general setup that is relevant to all initialization modes, regardless
65
63
  # of the availability of the TestHelper API.
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # rubocop:disable Style/GlobalVars # TODO: investigate the use of instance variables
4
-
5
3
  require 'fileutils'
6
4
  require 'tempfile'
7
5
  require 'pathname'
@@ -27,9 +27,7 @@ module PuppetlabsSpec
27
27
  # dir as returned by my_fixture_dir.
28
28
  def my_fixture(name)
29
29
  file = File.join(my_fixture_dir, name)
30
- unless File.readable? file
31
- raise "fixture '#{name}' for #{my_fixture_dir} is not readable"
32
- end
30
+ raise "fixture '#{name}' for #{my_fixture_dir} is not readable" unless File.readable? file
33
31
 
34
32
  file
35
33
  end
@@ -44,9 +42,7 @@ module PuppetlabsSpec
44
42
  # area.
45
43
  def my_fixtures(glob = '*', flags = 0, &block)
46
44
  files = Dir.glob(File.join(my_fixture_dir, glob), flags)
47
- if files.empty?
48
- raise "fixture '#{glob}' for #{my_fixture_dir} had no files!"
49
- end
45
+ raise "fixture '#{glob}' for #{my_fixture_dir} had no files!" if files.empty?
50
46
 
51
47
  block && files.each(&block)
52
48
  files