puppet-lint 4.2.0 → 4.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +18 -4
  3. data/lib/puppet-lint/lexer.rb +2 -2
  4. data/lib/puppet-lint/plugins/legacy_facts/legacy_facts.rb +2 -2
  5. data/lib/puppet-lint/plugins/top_scope_facts/top_scope_facts.rb +4 -4
  6. data/lib/puppet-lint/version.rb +1 -1
  7. data/rubocop_baseline.yml +7 -0
  8. data/spec/spec_helper.rb +0 -1
  9. data/spec/unit/puppet-lint/checks_spec.rb +7 -2
  10. data/spec/unit/puppet-lint/ignore_overrides_spec.rb +6 -6
  11. data/spec/unit/puppet-lint/lexer_spec.rb +702 -699
  12. data/spec/unit/puppet-lint/plugins/check_classes/arrow_on_right_operand_line_spec.rb +5 -5
  13. data/spec/unit/puppet-lint/plugins/check_classes/autoloader_layout_spec.rb +8 -8
  14. data/spec/unit/puppet-lint/plugins/check_classes/class_inherits_from_params_class_spec.rb +2 -2
  15. data/spec/unit/puppet-lint/plugins/check_classes/code_on_top_scope_spec.rb +2 -1
  16. data/spec/unit/puppet-lint/plugins/check_classes/inherits_across_namespaces_spec.rb +3 -3
  17. data/spec/unit/puppet-lint/plugins/check_classes/name_contains_uppercase_spec.rb +3 -3
  18. data/spec/unit/puppet-lint/plugins/check_classes/names_containing_dash_spec.rb +3 -3
  19. data/spec/unit/puppet-lint/plugins/check_classes/nested_classes_or_defines_spec.rb +5 -5
  20. data/spec/unit/puppet-lint/plugins/check_classes/parameter_order_spec.rb +14 -14
  21. data/spec/unit/puppet-lint/plugins/check_classes/right_to_left_relationship_spec.rb +2 -2
  22. data/spec/unit/puppet-lint/plugins/check_classes/variable_scope_spec.rb +21 -21
  23. data/spec/unit/puppet-lint/plugins/check_comments/slash_comments_spec.rb +2 -2
  24. data/spec/unit/puppet-lint/plugins/check_comments/star_comments_spec.rb +4 -4
  25. data/spec/unit/puppet-lint/plugins/check_conditionals/case_without_default_spec.rb +6 -6
  26. data/spec/unit/puppet-lint/plugins/check_conditionals/selector_inside_resource_spec.rb +2 -2
  27. data/spec/unit/puppet-lint/plugins/check_documentation/documentation_spec.rb +5 -5
  28. data/spec/unit/puppet-lint/plugins/check_nodes/unquoted_node_name_spec.rb +11 -11
  29. data/spec/unit/puppet-lint/plugins/check_resources/duplicate_params_spec.rb +6 -6
  30. data/spec/unit/puppet-lint/plugins/check_resources/ensure_first_param_spec.rb +12 -12
  31. data/spec/unit/puppet-lint/plugins/check_resources/ensure_not_symlink_target_spec.rb +4 -4
  32. data/spec/unit/puppet-lint/plugins/check_resources/file_mode_spec.rb +22 -22
  33. data/spec/unit/puppet-lint/plugins/check_resources/unquoted_file_mode_spec.rb +8 -8
  34. data/spec/unit/puppet-lint/plugins/check_resources/unquoted_resource_title_spec.rb +13 -13
  35. data/spec/unit/puppet-lint/plugins/check_strings/double_quoted_strings_spec.rb +18 -18
  36. data/spec/unit/puppet-lint/plugins/check_strings/only_variable_string_spec.rb +6 -6
  37. data/spec/unit/puppet-lint/plugins/check_strings/puppet_url_without_modules_spec.rb +4 -4
  38. data/spec/unit/puppet-lint/plugins/check_strings/quoted_booleans_spec.rb +8 -8
  39. data/spec/unit/puppet-lint/plugins/check_strings/single_quote_string_with_variables_spec.rb +3 -3
  40. data/spec/unit/puppet-lint/plugins/check_strings/variables_not_enclosed_spec.rb +7 -7
  41. data/spec/unit/puppet-lint/plugins/check_variables/variable_contains_dash_spec.rb +2 -2
  42. data/spec/unit/puppet-lint/plugins/check_variables/variable_is_lowercase_spec.rb +5 -5
  43. data/spec/unit/puppet-lint/plugins/check_whitespace/140chars_spec.rb +4 -4
  44. data/spec/unit/puppet-lint/plugins/check_whitespace/2sp_soft_tabs_spec.rb +1 -1
  45. data/spec/unit/puppet-lint/plugins/check_whitespace/80chars_spec.rb +4 -4
  46. data/spec/unit/puppet-lint/plugins/check_whitespace/arrow_alignment_spec.rb +37 -37
  47. data/spec/unit/puppet-lint/plugins/check_whitespace/hard_tabs_spec.rb +2 -2
  48. data/spec/unit/puppet-lint/plugins/check_whitespace/trailing_whitespace_spec.rb +6 -6
  49. data/spec/unit/puppet-lint/plugins/legacy_facts/legacy_facts_spec.rb +83 -75
  50. data/spec/unit/puppet-lint/plugins/top_scope_facts/top_scope_facts_spec.rb +19 -19
  51. metadata +6 -4
@@ -19,7 +19,7 @@ describe 'arrow_alignment' do
19
19
  end
20
20
 
21
21
  it 'does not detect any problems' do
22
- expect(problems).to have(0).problems
22
+ expect(problems).to be_empty
23
23
  end
24
24
  end
25
25
 
@@ -37,7 +37,7 @@ describe 'arrow_alignment' do
37
37
  end
38
38
 
39
39
  it 'does not detect any problems' do
40
- expect(problems).to have(0).problems
40
+ expect(problems).to be_empty
41
41
  end
42
42
  end
43
43
 
@@ -55,7 +55,7 @@ describe 'arrow_alignment' do
55
55
  end
56
56
 
57
57
  it 'does not detect any problems' do
58
- expect(problems).to have(0).problems
58
+ expect(problems).to be_empty
59
59
  end
60
60
  end
61
61
 
@@ -76,7 +76,7 @@ describe 'arrow_alignment' do
76
76
  end
77
77
 
78
78
  it 'does not detect any problems' do
79
- expect(problems).to have(0).problems
79
+ expect(problems).to be_empty
80
80
  end
81
81
  end
82
82
 
@@ -111,7 +111,7 @@ describe 'arrow_alignment' do
111
111
  end
112
112
 
113
113
  it 'does not detect any problems' do
114
- expect(problems).to have(0).problems
114
+ expect(problems).to be_empty
115
115
  end
116
116
  end
117
117
 
@@ -129,7 +129,7 @@ describe 'arrow_alignment' do
129
129
  end
130
130
 
131
131
  it 'detects four problems' do
132
- expect(problems).to have(4).problems
132
+ expect(problems.size).to eq(4)
133
133
  end
134
134
 
135
135
  it 'creates four warnings' do
@@ -154,7 +154,7 @@ describe 'arrow_alignment' do
154
154
  end
155
155
 
156
156
  it 'detects four problems' do
157
- expect(problems).to have(4).problems
157
+ expect(problems.size).to eq(4)
158
158
  end
159
159
 
160
160
  it 'creates four warnings' do
@@ -181,7 +181,7 @@ describe 'arrow_alignment' do
181
181
  end
182
182
 
183
183
  it 'detects three problems' do
184
- expect(problems).to have(3).problems
184
+ expect(problems.size).to eq(3)
185
185
  end
186
186
 
187
187
  it 'creates three warnings' do
@@ -206,7 +206,7 @@ describe 'arrow_alignment' do
206
206
  end
207
207
 
208
208
  it 'only detects a single problem' do
209
- expect(problems).to have(1).problem
209
+ expect(problems.size).to eq(1)
210
210
  end
211
211
 
212
212
  it 'creates a warning' do
@@ -233,7 +233,7 @@ describe 'arrow_alignment' do
233
233
  end
234
234
 
235
235
  it 'only detects a single problem' do
236
- expect(problems).to have(4).problem
236
+ expect(problems.size).to eq(4)
237
237
  end
238
238
 
239
239
  it 'creates a warning' do
@@ -253,7 +253,7 @@ describe 'arrow_alignment' do
253
253
  end
254
254
 
255
255
  it 'does not detect any problems' do
256
- expect(problems).to have(0).problems
256
+ expect(problems).to be_empty
257
257
  end
258
258
  end
259
259
 
@@ -268,7 +268,7 @@ describe 'arrow_alignment' do
268
268
  end
269
269
 
270
270
  it 'does not detect any problems' do
271
- expect(problems).to have(0).problems
271
+ expect(problems).to be_empty
272
272
  end
273
273
  end
274
274
 
@@ -282,7 +282,7 @@ describe 'arrow_alignment' do
282
282
  end
283
283
 
284
284
  it 'does not detect any problems' do
285
- expect(problems).to have(0).problems
285
+ expect(problems).to be_empty
286
286
  end
287
287
  end
288
288
 
@@ -296,7 +296,7 @@ describe 'arrow_alignment' do
296
296
  end
297
297
 
298
298
  it 'does not detect any problems' do
299
- expect(problems).to have(0).problems
299
+ expect(problems).to be_empty
300
300
  end
301
301
  end
302
302
 
@@ -311,7 +311,7 @@ describe 'arrow_alignment' do
311
311
  end
312
312
 
313
313
  it 'detects 2 problems' do
314
- expect(problems).to have(2).problems
314
+ expect(problems.size).to eq(2)
315
315
  end
316
316
 
317
317
  it 'creates 2 warnings' do
@@ -332,7 +332,7 @@ describe 'arrow_alignment' do
332
332
  end
333
333
 
334
334
  it 'does not detect any problems' do
335
- expect(problems).to have(0).problems
335
+ expect(problems).to be_empty
336
336
  end
337
337
  end
338
338
 
@@ -347,7 +347,7 @@ describe 'arrow_alignment' do
347
347
  end
348
348
 
349
349
  it 'detects 2 problems' do
350
- expect(problems).to have(2).problems
350
+ expect(problems.size).to eq(2)
351
351
  end
352
352
 
353
353
  it 'creates 2 warnings' do
@@ -367,7 +367,7 @@ describe 'arrow_alignment' do
367
367
  end
368
368
 
369
369
  it 'does not detect any problems' do
370
- expect(problems).to have(0).problems
370
+ expect(problems).to be_empty
371
371
  end
372
372
  end
373
373
 
@@ -384,7 +384,7 @@ describe 'arrow_alignment' do
384
384
  end
385
385
 
386
386
  it 'does not detect any problems' do
387
- expect(problems).to have(0).problems
387
+ expect(problems).to be_empty
388
388
  end
389
389
  end
390
390
 
@@ -401,7 +401,7 @@ describe 'arrow_alignment' do
401
401
  end
402
402
 
403
403
  it 'detects one problem' do
404
- expect(problems).to have(1).problem
404
+ expect(problems.size).to eq(1)
405
405
  end
406
406
 
407
407
  it 'creates one warning' do
@@ -423,7 +423,7 @@ describe 'arrow_alignment' do
423
423
  end
424
424
 
425
425
  it 'does not detect any problems' do
426
- expect(problems).to have(0).problems
426
+ expect(problems).to be_empty
427
427
  end
428
428
  end
429
429
 
@@ -441,7 +441,7 @@ describe 'arrow_alignment' do
441
441
  end
442
442
 
443
443
  it 'detects 2 problems' do
444
- expect(problems).to have(2).problems
444
+ expect(problems.size).to eq(2)
445
445
  end
446
446
 
447
447
  it 'creates 2 warnings' do
@@ -470,14 +470,14 @@ describe 'arrow_alignment' do
470
470
  end
471
471
 
472
472
  it 'does not detect any problems' do
473
- expect(problems).to have(0).problems
473
+ expect(problems).to be_empty
474
474
  end
475
475
  end
476
476
 
477
477
  context 'where the top level of the block has no parameters' do
478
478
  let(:code) do
479
479
  <<-END
480
- case $::osfamily {
480
+ case $facts['os']['family'] {
481
481
  'RedHat': {
482
482
  $datadir = $::operatingsystem ? {
483
483
  'Amazon' => pick($datadir, 'value'),
@@ -489,7 +489,7 @@ describe 'arrow_alignment' do
489
489
  end
490
490
 
491
491
  it 'does not detect any problems' do
492
- expect(problems).to have(0).problems
492
+ expect(problems).to be_empty
493
493
  end
494
494
  end
495
495
  end
@@ -529,7 +529,7 @@ describe 'arrow_alignment' do
529
529
  end
530
530
 
531
531
  it 'detects four problems' do
532
- expect(problems).to have(4).problems
532
+ expect(problems.size).to eq(4)
533
533
  end
534
534
 
535
535
  it 'fixes the manifest' do
@@ -574,7 +574,7 @@ describe 'arrow_alignment' do
574
574
  end
575
575
 
576
576
  it 'detects three problems' do
577
- expect(problems).to have(3).problems
577
+ expect(problems.size).to eq(3)
578
578
  end
579
579
 
580
580
  it 'fixes the manifest' do
@@ -616,7 +616,7 @@ describe 'arrow_alignment' do
616
616
  end
617
617
 
618
618
  it 'only detects a single problem' do
619
- expect(problems).to have(1).problem
619
+ expect(problems.size).to eq(1)
620
620
  end
621
621
 
622
622
  it 'fixes the manifest' do
@@ -648,7 +648,7 @@ describe 'arrow_alignment' do
648
648
  end
649
649
 
650
650
  it 'detects 2 problems' do
651
- expect(problems).to have(2).problems
651
+ expect(problems.size).to eq(2)
652
652
  end
653
653
 
654
654
  it 'creates 2 warnings' do
@@ -681,7 +681,7 @@ describe 'arrow_alignment' do
681
681
  end
682
682
 
683
683
  it 'detects 1 problem' do
684
- expect(problems).to have(1).problem
684
+ expect(problems.size).to eq(1)
685
685
  end
686
686
 
687
687
  it 'fixes the problem' do
@@ -714,7 +714,7 @@ describe 'arrow_alignment' do
714
714
  end
715
715
 
716
716
  it 'detects 2 problems' do
717
- expect(problems).to have(2).problems
717
+ expect(problems.size).to eq(2)
718
718
  end
719
719
 
720
720
  it 'fixes 2 problems' do
@@ -748,7 +748,7 @@ describe 'arrow_alignment' do
748
748
  end
749
749
 
750
750
  it 'detects 2 problems' do
751
- expect(problems).to have(3).problems
751
+ expect(problems.size).to eq(3)
752
752
  end
753
753
 
754
754
  it 'fixes 2 problems' do
@@ -788,7 +788,7 @@ describe 'arrow_alignment' do
788
788
  end
789
789
 
790
790
  it 'detects 2 problems' do
791
- expect(problems).to have(2).problems
791
+ expect(problems.size).to eq(2)
792
792
  end
793
793
 
794
794
  it 'fixes 2 problems' do
@@ -839,7 +839,7 @@ describe 'arrow_alignment' do
839
839
  end
840
840
 
841
841
  it 'detects 1 problem' do
842
- expect(problems).to have(1).problems
842
+ expect(problems.size).to eq(1)
843
843
  end
844
844
 
845
845
  it 'fixes 1 problem' do
@@ -897,7 +897,7 @@ describe 'arrow_alignment' do
897
897
  end
898
898
 
899
899
  it 'detects 5 problems' do
900
- expect(problems).to have(5).problems
900
+ expect(problems.size).to eq(5)
901
901
  end
902
902
 
903
903
  it 'fixes 5 problems' do
@@ -949,7 +949,7 @@ describe 'arrow_alignment' do
949
949
  end
950
950
 
951
951
  it 'detects 8 problems' do
952
- expect(problems).to have(8).problems
952
+ expect(problems.size).to eq(8)
953
953
  end
954
954
 
955
955
  it 'fixes 8 problems' do
@@ -993,7 +993,7 @@ describe 'arrow_alignment' do
993
993
  end
994
994
 
995
995
  it 'detects a problem' do
996
- expect(problems).to have(1).problem
996
+ expect(problems.size).to eq(1)
997
997
  end
998
998
 
999
999
  it 'fixes the problems' do
@@ -8,7 +8,7 @@ describe 'hard_tabs' do
8
8
  let(:code) { "\tfoo => bar," }
9
9
 
10
10
  it 'only detects a single problem' do
11
- expect(problems).to have(1).problem
11
+ expect(problems.size).to eq(1)
12
12
  end
13
13
 
14
14
  it 'creates an error' do
@@ -30,7 +30,7 @@ describe 'hard_tabs' do
30
30
  let(:code) { "\tfoo => bar," }
31
31
 
32
32
  it 'only detects a single problem' do
33
- expect(problems).to have(1).problem
33
+ expect(problems.size).to eq(1)
34
34
  end
35
35
 
36
36
  it 'fixes the manifest' do
@@ -8,7 +8,7 @@ describe 'trailing_whitespace' do
8
8
  let(:code) { 'foo ' }
9
9
 
10
10
  it 'only detects a single problem' do
11
- expect(problems).to have(1).problem
11
+ expect(problems.size).to eq(1)
12
12
  end
13
13
 
14
14
  it 'creates an error' do
@@ -26,7 +26,7 @@ describe 'trailing_whitespace' do
26
26
  end
27
27
 
28
28
  it 'only detects a single problem' do
29
- expect(problems).to have(1).problem
29
+ expect(problems.size).to eq(1)
30
30
  end
31
31
 
32
32
  it 'creates an error' do
@@ -48,7 +48,7 @@ describe 'trailing_whitespace' do
48
48
  let(:code) { 'foo ' }
49
49
 
50
50
  it 'only detects a single problem' do
51
- expect(problems).to have(1).problem
51
+ expect(problems.size).to eq(1)
52
52
  end
53
53
 
54
54
  it 'fixes the manifest' do
@@ -64,7 +64,7 @@ describe 'trailing_whitespace' do
64
64
  let(:code) { "foo \nbar" }
65
65
 
66
66
  it 'only detects a single problem' do
67
- expect(problems).to have(1).problem
67
+ expect(problems.size).to eq(1)
68
68
  end
69
69
 
70
70
  it 'fixes the manifest' do
@@ -94,7 +94,7 @@ describe 'trailing_whitespace' do
94
94
  end
95
95
 
96
96
  it 'only detects a single problem' do
97
- expect(problems).to have(1).problem
97
+ expect(problems.size).to eq(1)
98
98
  end
99
99
 
100
100
  it 'creates an error' do
@@ -110,7 +110,7 @@ describe 'trailing_whitespace' do
110
110
  let(:code) { " \n " }
111
111
 
112
112
  it 'detects problems with both empty lines' do
113
- expect(problems).to have(2).problem
113
+ expect(problems.size).to eq(2)
114
114
  end
115
115
 
116
116
  it 'fixes the manifest' do