puppet-lint 2.5.2 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +522 -0
  3. data/lib/puppet-lint/bin.rb +71 -6
  4. data/lib/puppet-lint/checkplugin.rb +43 -9
  5. data/lib/puppet-lint/checks.rb +16 -16
  6. data/lib/puppet-lint/configuration.rb +134 -134
  7. data/lib/puppet-lint/data.rb +28 -28
  8. data/lib/puppet-lint/lexer/string_slurper.rb +138 -140
  9. data/lib/puppet-lint/lexer/token.rb +188 -190
  10. data/lib/puppet-lint/lexer.rb +416 -417
  11. data/lib/puppet-lint/monkeypatches.rb +1 -1
  12. data/lib/puppet-lint/optparser.rb +5 -1
  13. data/lib/puppet-lint/plugins/check_classes/arrow_on_right_operand_line.rb +6 -4
  14. data/lib/puppet-lint/plugins/check_classes/autoloader_layout.rb +5 -3
  15. data/lib/puppet-lint/plugins/check_classes/class_inherits_from_params_class.rb +6 -4
  16. data/lib/puppet-lint/plugins/check_classes/code_on_top_scope.rb +5 -3
  17. data/lib/puppet-lint/plugins/check_classes/inherits_across_namespaces.rb +5 -3
  18. data/lib/puppet-lint/plugins/check_classes/names_containing_dash.rb +5 -3
  19. data/lib/puppet-lint/plugins/check_classes/names_containing_uppercase.rb +7 -5
  20. data/lib/puppet-lint/plugins/check_classes/nested_classes_or_defines.rb +5 -3
  21. data/lib/puppet-lint/plugins/check_classes/parameter_order.rb +7 -4
  22. data/lib/puppet-lint/plugins/check_classes/right_to_left_relationship.rb +5 -3
  23. data/lib/puppet-lint/plugins/check_classes/variable_scope.rb +15 -13
  24. data/lib/puppet-lint/plugins/check_comments/slash_comments.rb +9 -7
  25. data/lib/puppet-lint/plugins/check_comments/star_comments.rb +10 -8
  26. data/lib/puppet-lint/plugins/check_conditionals/case_without_default.rb +6 -4
  27. data/lib/puppet-lint/plugins/check_conditionals/selector_inside_resource.rb +5 -3
  28. data/lib/puppet-lint/plugins/check_documentation/documentation.rb +7 -3
  29. data/lib/puppet-lint/plugins/check_nodes/unquoted_node_name.rb +15 -11
  30. data/lib/puppet-lint/plugins/check_resources/duplicate_params.rb +5 -3
  31. data/lib/puppet-lint/plugins/check_resources/ensure_first_param.rb +8 -5
  32. data/lib/puppet-lint/plugins/check_resources/ensure_not_symlink_target.rb +11 -8
  33. data/lib/puppet-lint/plugins/check_resources/file_mode.rb +14 -9
  34. data/lib/puppet-lint/plugins/check_resources/unquoted_file_mode.rb +11 -6
  35. data/lib/puppet-lint/plugins/check_resources/unquoted_resource_title.rb +6 -4
  36. data/lib/puppet-lint/plugins/check_strings/double_quoted_strings.rb +12 -7
  37. data/lib/puppet-lint/plugins/check_strings/only_variable_string.rb +8 -6
  38. data/lib/puppet-lint/plugins/check_strings/puppet_url_without_modules.rb +14 -8
  39. data/lib/puppet-lint/plugins/check_strings/quoted_booleans.rb +11 -7
  40. data/lib/puppet-lint/plugins/check_strings/single_quote_string_with_variables.rb +11 -6
  41. data/lib/puppet-lint/plugins/check_strings/variables_not_enclosed.rb +12 -8
  42. data/lib/puppet-lint/plugins/check_variables/variable_contains_dash.rb +11 -7
  43. data/lib/puppet-lint/plugins/check_variables/variable_is_lowercase.rb +11 -7
  44. data/lib/puppet-lint/plugins/check_whitespace/140chars.rb +3 -8
  45. data/lib/puppet-lint/plugins/check_whitespace/2sp_soft_tabs.rb +10 -8
  46. data/lib/puppet-lint/plugins/check_whitespace/80chars.rb +3 -8
  47. data/lib/puppet-lint/plugins/check_whitespace/arrow_alignment.rb +10 -8
  48. data/lib/puppet-lint/plugins/check_whitespace/hard_tabs.rb +11 -7
  49. data/lib/puppet-lint/plugins/check_whitespace/line_length.rb +29 -0
  50. data/lib/puppet-lint/plugins/check_whitespace/trailing_whitespace.rb +13 -7
  51. data/lib/puppet-lint/plugins.rb +60 -61
  52. data/lib/puppet-lint/report/github.rb +17 -0
  53. data/lib/puppet-lint/report/sarif_template.json +63 -0
  54. data/lib/puppet-lint/tasks/puppet-lint.rb +84 -83
  55. data/lib/puppet-lint/tasks/release_test.rb +4 -1
  56. data/lib/puppet-lint/version.rb +1 -1
  57. data/lib/puppet-lint.rb +27 -12
  58. data/spec/acceptance/puppet_lint_spec.rb +46 -0
  59. data/spec/spec_helper.rb +92 -91
  60. data/spec/spec_helper_acceptance.rb +6 -0
  61. data/spec/spec_helper_acceptance_local.rb +38 -0
  62. data/spec/{puppet-lint → unit/puppet-lint}/bin_spec.rb +79 -35
  63. data/spec/{puppet-lint → unit/puppet-lint}/checks_spec.rb +36 -36
  64. data/spec/unit/puppet-lint/configuration_spec.rb +88 -0
  65. data/spec/{puppet-lint → unit/puppet-lint}/data_spec.rb +6 -3
  66. data/spec/{puppet-lint → unit/puppet-lint}/ignore_overrides_spec.rb +17 -17
  67. data/spec/{puppet-lint → unit/puppet-lint}/lexer/string_slurper_spec.rb +128 -128
  68. data/spec/{puppet-lint → unit/puppet-lint}/lexer/token_spec.rb +1 -1
  69. data/spec/{puppet-lint → unit/puppet-lint}/lexer_spec.rb +653 -671
  70. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/arrow_on_right_operand_line_spec.rb +16 -16
  71. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/autoloader_layout_spec.rb +13 -13
  72. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/class_inherits_from_params_class_spec.rb +3 -3
  73. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/code_on_top_scope_spec.rb +4 -4
  74. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/inherits_across_namespaces_spec.rb +4 -4
  75. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/name_contains_uppercase_spec.rb +10 -10
  76. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/names_containing_dash_spec.rb +7 -7
  77. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/nested_classes_or_defines_spec.rb +7 -7
  78. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/parameter_order_spec.rb +9 -9
  79. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/right_to_left_relationship_spec.rb +3 -3
  80. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_classes/variable_scope_spec.rb +25 -25
  81. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_comments/slash_comments_spec.rb +7 -7
  82. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_comments/star_comments_spec.rb +13 -13
  83. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_conditionals/case_without_default_spec.rb +10 -10
  84. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_conditionals/selector_inside_resource_spec.rb +3 -3
  85. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_documentation/documentation_spec.rb +8 -8
  86. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_nodes/unquoted_node_name_spec.rb +24 -24
  87. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_resources/duplicate_params_spec.rb +9 -9
  88. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_resources/ensure_first_param_spec.rb +19 -19
  89. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_resources/ensure_not_symlink_target_spec.rb +10 -10
  90. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_resources/file_mode_spec.rb +40 -40
  91. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_resources/unquoted_file_mode_spec.rb +20 -20
  92. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_resources/unquoted_resource_title_spec.rb +24 -24
  93. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_strings/double_quoted_strings_spec.rb +27 -27
  94. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_strings/only_variable_string_spec.rb +18 -18
  95. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_strings/puppet_url_without_modules_spec.rb +9 -9
  96. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_strings/quoted_booleans_spec.rb +22 -22
  97. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_strings/single_quote_string_with_variables_spec.rb +2 -2
  98. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_strings/variables_not_enclosed_spec.rb +21 -21
  99. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_variables/variable_contains_dash_spec.rb +6 -6
  100. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_variables/variable_is_lowercase_spec.rb +7 -7
  101. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_whitespace/140chars_spec.rb +5 -5
  102. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_whitespace/2sp_soft_tabs_spec.rb +2 -2
  103. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_whitespace/80chars_spec.rb +6 -6
  104. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_whitespace/arrow_alignment_spec.rb +127 -127
  105. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_whitespace/hard_tabs_spec.rb +7 -7
  106. data/spec/{puppet-lint → unit/puppet-lint}/plugins/check_whitespace/trailing_whitespace_spec.rb +15 -15
  107. data/spec/unit/puppet-lint/puppet-lint_spec.rb +18 -0
  108. metadata +63 -119
  109. data/CHANGELOG.md +0 -33
  110. data/HISTORY.md +0 -1130
  111. data/spec/puppet-lint/configuration_spec.rb +0 -66
  112. data/spec/puppet-lint_spec.rb +0 -16
@@ -15,11 +15,11 @@ describe 'duplicate_params' do
15
15
  END
16
16
  end
17
17
 
18
- it 'should only detect a single problem' do
18
+ it 'only detects a single problem' do
19
19
  expect(problems).to have(1).problem
20
20
  end
21
21
 
22
- it 'should create an error' do
22
+ it 'creates an error' do
23
23
  expect(problems).to contain_error(msg).on_line(5).in_column(11)
24
24
  end
25
25
  end
@@ -36,7 +36,7 @@ describe 'duplicate_params' do
36
36
  END
37
37
  end
38
38
 
39
- it 'should not detect any errors' do
39
+ it 'does not detect any errors' do
40
40
  expect(problems).to have(0).problems
41
41
  end
42
42
  end
@@ -53,11 +53,11 @@ describe 'duplicate_params' do
53
53
  END
54
54
  end
55
55
 
56
- it 'should only detect a single error' do
56
+ it 'only detects a single error' do
57
57
  expect(problems).to have(1).problem
58
58
  end
59
59
 
60
- it 'should create an error' do
60
+ it 'creates an error' do
61
61
  expect(problems).to contain_error(msg).on_line(4).in_column(15)
62
62
  end
63
63
  end
@@ -76,11 +76,11 @@ describe 'duplicate_params' do
76
76
  END
77
77
  end
78
78
 
79
- it 'should only detect a single problem' do
79
+ it 'only detects a single problem' do
80
80
  expect(problems).to have(1).problem
81
81
  end
82
82
 
83
- it 'should create an error' do
83
+ it 'creates an error' do
84
84
  expect(problems).to contain_error(msg).on_line(7).in_column(11)
85
85
  end
86
86
  end
@@ -95,7 +95,7 @@ describe 'duplicate_params' do
95
95
  END
96
96
  end
97
97
 
98
- it 'should not detect any problems' do
98
+ it 'does not detect any problems' do
99
99
  expect(problems).to have(0).problems
100
100
  end
101
101
  end
@@ -103,7 +103,7 @@ describe 'duplicate_params' do
103
103
  context 'colon as last token in file' do
104
104
  let(:code) { '}:' }
105
105
 
106
- it 'should not detect any problems' do
106
+ it 'does not detect any problems' do
107
107
  expect(problems).to have(0).problems
108
108
  end
109
109
  end
@@ -7,7 +7,7 @@ describe 'ensure_first_param' do
7
7
  context 'ensure as only attr in a single line resource' do
8
8
  let(:code) { "file { 'foo': ensure => present }" }
9
9
 
10
- it 'should not detect any problems' do
10
+ it 'does not detect any problems' do
11
11
  expect(problems).to have(0).problems
12
12
  end
13
13
  end
@@ -21,7 +21,7 @@ describe 'ensure_first_param' do
21
21
  END
22
22
  end
23
23
 
24
- it 'should not detect any problems' do
24
+ it 'does not detect any problems' do
25
25
  expect(problems).to have(0).problems
26
26
  end
27
27
  end
@@ -36,11 +36,11 @@ describe 'ensure_first_param' do
36
36
  END
37
37
  end
38
38
 
39
- it 'should only detect a single problem' do
39
+ it 'only detects a single problem' do
40
40
  expect(problems).to have(1).problem
41
41
  end
42
42
 
43
- it 'should create a warning' do
43
+ it 'creates a warning' do
44
44
  expect(problems).to contain_warning(msg).on_line(3).in_column(13)
45
45
  end
46
46
  end
@@ -55,7 +55,7 @@ describe 'ensure_first_param' do
55
55
  END
56
56
  end
57
57
 
58
- it 'should not detect any problems' do
58
+ it 'does not detect any problems' do
59
59
  expect(problems).to have(0).problems
60
60
  end
61
61
  end
@@ -76,7 +76,7 @@ describe 'ensure_first_param' do
76
76
  END
77
77
  end
78
78
 
79
- it 'should not detect any problems' do
79
+ it 'does not detect any problems' do
80
80
  expect(problems).to have(0).problems
81
81
  end
82
82
  end
@@ -92,25 +92,25 @@ describe 'ensure_first_param' do
92
92
  END
93
93
  end
94
94
 
95
- it 'should not detect any problems' do
95
+ it 'does not detect any problems' do
96
96
  expect(problems).to have(0).problems
97
97
  end
98
98
  end
99
99
  end
100
100
 
101
101
  context 'with fix enabled' do
102
- before do
102
+ before(:each) do
103
103
  PuppetLint.configuration.fix = true
104
104
  end
105
105
 
106
- after do
106
+ after(:each) do
107
107
  PuppetLint.configuration.fix = false
108
108
  end
109
109
 
110
110
  context 'ensure as only attr in a single line resource' do
111
111
  let(:code) { "file { 'foo': ensure => present }" }
112
112
 
113
- it 'should not detect any problems' do
113
+ it 'does not detect any problems' do
114
114
  expect(problems).to have(0).problems
115
115
  end
116
116
  end
@@ -124,7 +124,7 @@ describe 'ensure_first_param' do
124
124
  END
125
125
  end
126
126
 
127
- it 'should not detect any problems' do
127
+ it 'does not detect any problems' do
128
128
  expect(problems).to have(0).problems
129
129
  end
130
130
  end
@@ -148,15 +148,15 @@ describe 'ensure_first_param' do
148
148
  END
149
149
  end
150
150
 
151
- it 'should only detect a single problem' do
151
+ it 'only detects a single problem' do
152
152
  expect(problems).to have(1).problem
153
153
  end
154
154
 
155
- it 'should create a warning' do
155
+ it 'creates a warning' do
156
156
  expect(problems).to contain_fixed(msg).on_line(3).in_column(13)
157
157
  end
158
158
 
159
- it 'should make ensure the first attr' do
159
+ it 'makes ensure the first attr' do
160
160
  expect(manifest).to eq(fixed)
161
161
  end
162
162
  end
@@ -171,7 +171,7 @@ describe 'ensure_first_param' do
171
171
  END
172
172
  end
173
173
 
174
- it 'should not detect any problems' do
174
+ it 'does not detect any problems' do
175
175
  expect(problems).to have(0).problems
176
176
  end
177
177
  end
@@ -192,7 +192,7 @@ describe 'ensure_first_param' do
192
192
  END
193
193
  end
194
194
 
195
- it 'should not detect any problems' do
195
+ it 'does not detect any problems' do
196
196
  expect(problems).to have(0).problems
197
197
  end
198
198
  end
@@ -228,15 +228,15 @@ describe 'ensure_first_param' do
228
228
  END
229
229
  end
230
230
 
231
- it 'should detect a problem' do
231
+ it 'detects a problem' do
232
232
  expect(problems).to have(1).problem
233
233
  end
234
234
 
235
- it 'should fix the problem' do
235
+ it 'fixes the problem' do
236
236
  expect(problems).to contain_fixed(msg).on_line(3).in_column(13)
237
237
  end
238
238
 
239
- it 'should move the whole ensure parameter to the top' do
239
+ it 'moves the whole ensure parameter to the top' do
240
240
  expect(manifest).to eq(fixed)
241
241
  end
242
242
  end
@@ -14,7 +14,7 @@ describe 'ensure_not_symlink_target' do
14
14
  END
15
15
  end
16
16
 
17
- it 'should not detect any problems' do
17
+ it 'does not detect any problems' do
18
18
  expect(problems).to have(0).problems
19
19
  end
20
20
  end
@@ -28,22 +28,22 @@ describe 'ensure_not_symlink_target' do
28
28
  END
29
29
  end
30
30
 
31
- it 'should only detect a single problem' do
31
+ it 'only detects a single problem' do
32
32
  expect(problems).to have(1).problem
33
33
  end
34
34
 
35
- it 'should create a warning' do
35
+ it 'creates a warning' do
36
36
  expect(problems).to contain_warning(msg).on_line(2).in_column(23)
37
37
  end
38
38
  end
39
39
  end
40
40
 
41
41
  context 'with fix enabled' do
42
- before do
42
+ before(:each) do
43
43
  PuppetLint.configuration.fix = true
44
44
  end
45
45
 
46
- after do
46
+ after(:each) do
47
47
  PuppetLint.configuration.fix = false
48
48
  end
49
49
 
@@ -57,11 +57,11 @@ describe 'ensure_not_symlink_target' do
57
57
  END
58
58
  end
59
59
 
60
- it 'should not detect any problems' do
60
+ it 'does not detect any problems' do
61
61
  expect(problems).to have(0).problems
62
62
  end
63
63
 
64
- it 'should not modify the manifest' do
64
+ it 'does not modify the manifest' do
65
65
  expect(manifest).to eq(code)
66
66
  end
67
67
  end
@@ -84,15 +84,15 @@ describe 'ensure_not_symlink_target' do
84
84
  END
85
85
  end
86
86
 
87
- it 'should only detect a single problem' do
87
+ it 'only detects a single problem' do
88
88
  expect(problems).to have(1).problem
89
89
  end
90
90
 
91
- it 'should fix the problem' do
91
+ it 'fixes the problem' do
92
92
  expect(problems).to contain_fixed(msg).on_line(2).in_column(23)
93
93
  end
94
94
 
95
- it 'should create a new target param' do
95
+ it 'creates a new target param' do
96
96
  expect(manifest).to eq(fixed)
97
97
  end
98
98
  end
@@ -7,11 +7,11 @@ describe 'file_mode' do
7
7
  context '3 digit file mode' do
8
8
  let(:code) { "file { 'foo': mode => '777' }" }
9
9
 
10
- it 'should only detect a single problem' do
10
+ it 'only detects a single problem' do
11
11
  expect(problems).to have(1).problem
12
12
  end
13
13
 
14
- it 'should create a warning' do
14
+ it 'creates a warning' do
15
15
  expect(problems).to contain_warning(msg).on_line(1).in_column(23)
16
16
  end
17
17
  end
@@ -19,7 +19,7 @@ describe 'file_mode' do
19
19
  context '4 digit file mode' do
20
20
  let(:code) { "file { 'foo': mode => '0777' }" }
21
21
 
22
- it 'should not detect any problems' do
22
+ it 'does not detect any problems' do
23
23
  expect(problems).to have(0).problems
24
24
  end
25
25
  end
@@ -27,7 +27,7 @@ describe 'file_mode' do
27
27
  context 'file mode as a variable' do
28
28
  let(:code) { "file { 'foo': mode => $file_mode }" }
29
29
 
30
- it 'should not detect any problems' do
30
+ it 'does not detect any problems' do
31
31
  expect(problems).to have(0).problems
32
32
  end
33
33
  end
@@ -35,7 +35,7 @@ describe 'file_mode' do
35
35
  context 'symbolic file mode' do
36
36
  let(:code) { "file { 'foo': mode => 'u=rw,og=r' }" }
37
37
 
38
- it 'should not detect any problems' do
38
+ it 'does not detect any problems' do
39
39
  expect(problems).to have(0).problems
40
40
  end
41
41
  end
@@ -43,7 +43,7 @@ describe 'file_mode' do
43
43
  context 'file mode undef unquoted' do
44
44
  let(:code) { "file { 'foo': mode => undef }" }
45
45
 
46
- it 'should not detect any problems' do
46
+ it 'does not detect any problems' do
47
47
  expect(problems).to have(0).problems
48
48
  end
49
49
  end
@@ -51,11 +51,11 @@ describe 'file_mode' do
51
51
  context 'file mode undef quoted' do
52
52
  let(:code) { "file { 'foo': mode => 'undef' }" }
53
53
 
54
- it 'should only detect a single problem' do
54
+ it 'only detects a single problem' do
55
55
  expect(problems).to have(1).problem
56
56
  end
57
57
 
58
- it 'should create a warning' do
58
+ it 'creates a warning' do
59
59
  expect(problems).to contain_warning(msg).on_line(1).in_column(23)
60
60
  end
61
61
  end
@@ -63,7 +63,7 @@ describe 'file_mode' do
63
63
  context 'mode as audit value' do
64
64
  let(:code) { "file { '/etc/passwd': audit => [ owner, mode ], }" }
65
65
 
66
- it 'should not detect any problems' do
66
+ it 'does not detect any problems' do
67
67
  expect(problems).to have(0).problems
68
68
  end
69
69
  end
@@ -71,11 +71,11 @@ describe 'file_mode' do
71
71
  context '3 digit concat mode' do
72
72
  let(:code) { "concat { 'foo': mode => '777' }" }
73
73
 
74
- it 'should only detect a single problem' do
74
+ it 'only detects a single problem' do
75
75
  expect(problems).to have(1).problem
76
76
  end
77
77
 
78
- it 'should create a warning' do
78
+ it 'creates a warning' do
79
79
  expect(problems).to contain_warning(msg).on_line(1).in_column(25)
80
80
  end
81
81
  end
@@ -83,7 +83,7 @@ describe 'file_mode' do
83
83
  context '4 digit concat mode' do
84
84
  let(:code) { "concat { 'foo': mode => '0777' }" }
85
85
 
86
- it 'should not detect any problems' do
86
+ it 'does not detect any problems' do
87
87
  expect(problems).to have(0).problems
88
88
  end
89
89
  end
@@ -91,7 +91,7 @@ describe 'file_mode' do
91
91
  context 'concat mode as a variable' do
92
92
  let(:code) { "concat { 'foo': mode => $concat_mode }" }
93
93
 
94
- it 'should not detect any problems' do
94
+ it 'does not detect any problems' do
95
95
  expect(problems).to have(0).problems
96
96
  end
97
97
  end
@@ -99,7 +99,7 @@ describe 'file_mode' do
99
99
  context 'symbolic concat mode' do
100
100
  let(:code) { "concat { 'foo': mode => 'u=rw,og=r' }" }
101
101
 
102
- it 'should not detect any problems' do
102
+ it 'does not detect any problems' do
103
103
  expect(problems).to have(0).problems
104
104
  end
105
105
  end
@@ -107,7 +107,7 @@ describe 'file_mode' do
107
107
  context 'concat mode undef unquoted' do
108
108
  let(:code) { "concat { 'foo': mode => undef }" }
109
109
 
110
- it 'should not detect any problems' do
110
+ it 'does not detect any problems' do
111
111
  expect(problems).to have(0).problems
112
112
  end
113
113
  end
@@ -115,11 +115,11 @@ describe 'file_mode' do
115
115
  context 'concat mode undef quoted' do
116
116
  let(:code) { "concat { 'foo': mode => 'undef' }" }
117
117
 
118
- it 'should only detect a single problem' do
118
+ it 'only detects a single problem' do
119
119
  expect(problems).to have(1).problem
120
120
  end
121
121
 
122
- it 'should create a warning' do
122
+ it 'creates a warning' do
123
123
  expect(problems).to contain_warning(msg).on_line(1).in_column(25)
124
124
  end
125
125
  end
@@ -127,7 +127,7 @@ describe 'file_mode' do
127
127
  context 'mode as audit value' do
128
128
  let(:code) { "concat { '/etc/passwd': audit => [ owner, mode ], }" }
129
129
 
130
- it 'should not detect any problems' do
130
+ it 'does not detect any problems' do
131
131
  expect(problems).to have(0).problems
132
132
  end
133
133
  end
@@ -135,7 +135,7 @@ describe 'file_mode' do
135
135
  context 'mode as a function return value' do
136
136
  let(:code) { "file { 'foo': mode => lookup('bar'), }" }
137
137
 
138
- it 'should not detect any problems' do
138
+ it 'does not detect any problems' do
139
139
  expect(problems).to have(0).problems
140
140
  end
141
141
  end
@@ -155,11 +155,11 @@ describe 'file_mode' do
155
155
  END
156
156
  end
157
157
 
158
- it 'should detect 3 problems' do
158
+ it 'detects 3 problems' do
159
159
  expect(problems).to have(3).problems
160
160
  end
161
161
 
162
- it 'should create three warnings' do
162
+ it 'creates three warnings' do
163
163
  expect(problems).to contain_warning(sprintf(msg)).on_line(4).in_column(23)
164
164
  expect(problems).to contain_warning(sprintf(msg)).on_line(6).in_column(23)
165
165
  expect(problems).to contain_warning(sprintf(msg)).on_line(8).in_column(23)
@@ -168,26 +168,26 @@ describe 'file_mode' do
168
168
  end
169
169
 
170
170
  context 'with fix enabled' do
171
- before do
171
+ before(:each) do
172
172
  PuppetLint.configuration.fix = true
173
173
  end
174
174
 
175
- after do
175
+ after(:each) do
176
176
  PuppetLint.configuration.fix = false
177
177
  end
178
178
 
179
179
  context '3 digit file mode' do
180
180
  let(:code) { "file { 'foo': mode => '777' }" }
181
181
 
182
- it 'should only detect a single problem' do
182
+ it 'only detects a single problem' do
183
183
  expect(problems).to have(1).problem
184
184
  end
185
185
 
186
- it 'should fix the manifest' do
186
+ it 'fixes the manifest' do
187
187
  expect(problems).to contain_fixed(msg).on_line(1).in_column(23)
188
188
  end
189
189
 
190
- it 'should zero pad the file mode' do
190
+ it 'zeroe pads the file mode' do
191
191
  expect(manifest).to eq("file { 'foo': mode => '0777' }")
192
192
  end
193
193
  end
@@ -195,15 +195,15 @@ describe 'file_mode' do
195
195
  context 'file mode undef quoted' do
196
196
  let(:code) { "file { 'foo': mode => 'undef' }" }
197
197
 
198
- it 'should only detect a single problem' do
198
+ it 'only detects a single problem' do
199
199
  expect(problems).to have(1).problem
200
200
  end
201
201
 
202
- it 'should create a warning' do
202
+ it 'creates a warning' do
203
203
  expect(problems).to contain_warning(msg).on_line(1).in_column(23)
204
204
  end
205
205
 
206
- it 'should not modify the original manifest' do
206
+ it 'does not modify the original manifest' do
207
207
  expect(manifest).to eq(code)
208
208
  end
209
209
  end
@@ -211,15 +211,15 @@ describe 'file_mode' do
211
211
  context '3 digit concat mode' do
212
212
  let(:code) { "concat { 'foo': mode => '777' }" }
213
213
 
214
- it 'should only detect a single problem' do
214
+ it 'only detects a single problem' do
215
215
  expect(problems).to have(1).problem
216
216
  end
217
217
 
218
- it 'should fix the manifest' do
218
+ it 'fixes the manifest' do
219
219
  expect(problems).to contain_fixed(msg).on_line(1).in_column(25)
220
220
  end
221
221
 
222
- it 'should zero pad the concat mode' do
222
+ it 'zero pads the concat mode' do
223
223
  expect(manifest).to eq("concat { 'foo': mode => '0777' }")
224
224
  end
225
225
  end
@@ -227,15 +227,15 @@ describe 'file_mode' do
227
227
  context 'concat mode undef quoted' do
228
228
  let(:code) { "concat { 'foo': mode => 'undef' }" }
229
229
 
230
- it 'should only detect a single problem' do
230
+ it 'only detects a single problem' do
231
231
  expect(problems).to have(1).problem
232
232
  end
233
233
 
234
- it 'should create a warning' do
234
+ it 'creates a warning' do
235
235
  expect(problems).to contain_warning(msg).on_line(1).in_column(25)
236
236
  end
237
237
 
238
- it 'should not modify the original manifest' do
238
+ it 'does not modify the original manifest' do
239
239
  expect(manifest).to eq(code)
240
240
  end
241
241
  end
@@ -243,11 +243,11 @@ describe 'file_mode' do
243
243
  context 'mode as a function return value' do
244
244
  let(:code) { "file { 'foo': mode => lookup('bar'), }" }
245
245
 
246
- it 'should not detect any problems' do
246
+ it 'does not detect any problems' do
247
247
  expect(problems).to have(0).problems
248
248
  end
249
249
 
250
- it 'should not change the manifest' do
250
+ it 'does not change the manifest' do
251
251
  expect(manifest).to eq(code)
252
252
  end
253
253
  end
@@ -281,17 +281,17 @@ describe 'file_mode' do
281
281
  END
282
282
  end
283
283
 
284
- it 'should detect 3 problems' do
284
+ it 'detects 3 problems' do
285
285
  expect(problems).to have(3).problems
286
286
  end
287
287
 
288
- it 'should fix 3 problems' do
288
+ it 'fixes 3 problems' do
289
289
  expect(problems).to contain_fixed(msg).on_line(4).in_column(23)
290
290
  expect(problems).to contain_fixed(msg).on_line(6).in_column(23)
291
291
  expect(problems).to contain_fixed(msg).on_line(8).in_column(23)
292
292
  end
293
293
 
294
- it 'should zero pad the file modes and change them to strings' do
294
+ it 'zero pads the file modes and change them to strings' do
295
295
  expect(manifest).to eq(fixed)
296
296
  end
297
297
  end