puppet-lint 2.3.0 → 2.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +74 -0
- data/.rubocop_todo.yml +89 -0
- data/.travis.yml +11 -9
- data/CHANGELOG.md +54 -0
- data/Gemfile +3 -0
- data/Rakefile +14 -3
- data/appveyor.yml +1 -4
- data/bin/puppet-lint +1 -1
- data/lib/puppet-lint.rb +25 -21
- data/lib/puppet-lint/bin.rb +15 -19
- data/lib/puppet-lint/checkplugin.rb +24 -17
- data/lib/puppet-lint/checks.rb +42 -31
- data/lib/puppet-lint/configuration.rb +11 -8
- data/lib/puppet-lint/data.rb +236 -164
- data/lib/puppet-lint/lexer.rb +225 -203
- data/lib/puppet-lint/lexer/token.rb +34 -18
- data/lib/puppet-lint/optparser.rb +33 -30
- data/lib/puppet-lint/plugins.rb +42 -38
- data/lib/puppet-lint/plugins/check_classes/arrow_on_right_operand_line.rb +26 -28
- data/lib/puppet-lint/plugins/check_classes/autoloader_layout.rb +21 -20
- data/lib/puppet-lint/plugins/check_classes/class_inherits_from_params_class.rb +8 -9
- data/lib/puppet-lint/plugins/check_classes/code_on_top_scope.rb +9 -8
- data/lib/puppet-lint/plugins/check_classes/inherits_across_namespaces.rb +12 -11
- data/lib/puppet-lint/plugins/check_classes/names_containing_dash.rb +13 -12
- data/lib/puppet-lint/plugins/check_classes/names_containing_uppercase.rb +14 -13
- data/lib/puppet-lint/plugins/check_classes/nested_classes_or_defines.rb +9 -10
- data/lib/puppet-lint/plugins/check_classes/parameter_order.rb +40 -31
- data/lib/puppet-lint/plugins/check_classes/right_to_left_relationship.rb +3 -2
- data/lib/puppet-lint/plugins/check_classes/variable_scope.rb +21 -24
- data/lib/puppet-lint/plugins/check_comments/slash_comments.rb +3 -2
- data/lib/puppet-lint/plugins/check_comments/star_comments.rb +6 -5
- data/lib/puppet-lint/plugins/check_conditionals/case_without_default.rb +21 -20
- data/lib/puppet-lint/plugins/check_conditionals/selector_inside_resource.rb +10 -13
- data/lib/puppet-lint/plugins/check_documentation/documentation.rb +26 -17
- data/lib/puppet-lint/plugins/check_nodes/unquoted_node_name.rb +11 -11
- data/lib/puppet-lint/plugins/check_resources/duplicate_params.rb +4 -3
- data/lib/puppet-lint/plugins/check_resources/ensure_first_param.rb +17 -18
- data/lib/puppet-lint/plugins/check_resources/ensure_not_symlink_target.rb +17 -16
- data/lib/puppet-lint/plugins/check_resources/file_mode.rb +22 -23
- data/lib/puppet-lint/plugins/check_resources/unquoted_file_mode.rb +14 -13
- data/lib/puppet-lint/plugins/check_resources/unquoted_resource_title.rb +9 -8
- data/lib/puppet-lint/plugins/check_strings/double_quoted_strings.rb +8 -8
- data/lib/puppet-lint/plugins/check_strings/only_variable_string.rb +29 -42
- data/lib/puppet-lint/plugins/check_strings/puppet_url_without_modules.rb +5 -4
- data/lib/puppet-lint/plugins/check_strings/quoted_booleans.rb +3 -2
- data/lib/puppet-lint/plugins/check_strings/single_quote_string_with_variables.rb +4 -3
- data/lib/puppet-lint/plugins/check_strings/variables_not_enclosed.rb +3 -2
- data/lib/puppet-lint/plugins/check_variables/variable_contains_dash.rb +9 -8
- data/lib/puppet-lint/plugins/check_variables/variable_is_lowercase.rb +9 -8
- data/lib/puppet-lint/plugins/check_whitespace/140chars.rb +9 -9
- data/lib/puppet-lint/plugins/check_whitespace/2sp_soft_tabs.rb +4 -3
- data/lib/puppet-lint/plugins/check_whitespace/80chars.rb +10 -10
- data/lib/puppet-lint/plugins/check_whitespace/arrow_alignment.rb +23 -22
- data/lib/puppet-lint/plugins/check_whitespace/hard_tabs.rb +3 -2
- data/lib/puppet-lint/plugins/check_whitespace/trailing_whitespace.rb +3 -2
- data/lib/puppet-lint/tasks/puppet-lint.rb +3 -3
- data/lib/puppet-lint/version.rb +1 -1
- data/puppet-lint.gemspec +4 -4
- data/spec/puppet-lint/bin_spec.rb +268 -140
- data/spec/puppet-lint/checks_spec.rb +229 -0
- data/spec/puppet-lint/configuration_spec.rb +10 -9
- data/spec/puppet-lint/data_spec.rb +84 -0
- data/spec/puppet-lint/ignore_overrides_spec.rb +71 -40
- data/spec/puppet-lint/lexer/token_spec.rb +1 -1
- data/spec/puppet-lint/lexer_spec.rb +306 -73
- data/spec/puppet-lint/plugins/check_classes/arrow_on_right_operand_line_spec.rb +12 -6
- data/spec/puppet-lint/plugins/check_classes/autoloader_layout_spec.rb +10 -10
- data/spec/puppet-lint/plugins/check_classes/class_inherits_from_params_class_spec.rb +15 -11
- data/spec/puppet-lint/plugins/check_classes/code_on_top_scope_spec.rb +26 -21
- data/spec/puppet-lint/plugins/check_classes/inherits_across_namespaces_spec.rb +3 -3
- data/spec/puppet-lint/plugins/check_classes/name_contains_uppercase_spec.rb +4 -5
- data/spec/puppet-lint/plugins/check_classes/names_containing_dash_spec.rb +13 -0
- data/spec/puppet-lint/plugins/check_classes/nested_classes_or_defines_spec.rb +33 -25
- data/spec/puppet-lint/plugins/check_classes/parameter_order_spec.rb +80 -55
- data/spec/puppet-lint/plugins/check_classes/right_to_left_relationship_spec.rb +2 -2
- data/spec/puppet-lint/plugins/check_classes/variable_scope_spec.rb +165 -130
- data/spec/puppet-lint/plugins/check_comments/slash_comments_spec.rb +2 -2
- data/spec/puppet-lint/plugins/check_comments/star_comments_spec.rb +53 -35
- data/spec/puppet-lint/plugins/check_conditionals/case_without_default_spec.rb +59 -49
- data/spec/puppet-lint/plugins/check_conditionals/selector_inside_resource_spec.rb +18 -14
- data/spec/puppet-lint/plugins/check_documentation/documentation_spec.rb +14 -10
- data/spec/puppet-lint/plugins/check_nodes/unquoted_node_name_spec.rb +7 -7
- data/spec/puppet-lint/plugins/check_resources/duplicate_params_spec.rb +54 -44
- data/spec/puppet-lint/plugins/check_resources/ensure_first_param_spec.rb +114 -89
- data/spec/puppet-lint/plugins/check_resources/ensure_not_symlink_target_spec.rb +41 -30
- data/spec/puppet-lint/plugins/check_resources/file_mode_spec.rb +46 -40
- data/spec/puppet-lint/plugins/check_resources/unquoted_file_mode_spec.rb +46 -40
- data/spec/puppet-lint/plugins/check_resources/unquoted_resource_title_spec.rb +95 -71
- data/spec/puppet-lint/plugins/check_strings/double_quoted_strings_spec.rb +28 -24
- data/spec/puppet-lint/plugins/check_strings/only_variable_string_spec.rb +11 -9
- data/spec/puppet-lint/plugins/check_strings/puppet_url_without_modules_spec.rb +1 -2
- data/spec/puppet-lint/plugins/check_strings/single_quote_string_with_variables_spec.rb +18 -14
- data/spec/puppet-lint/plugins/check_variables/variable_contains_dash_spec.rb +1 -1
- data/spec/puppet-lint/plugins/check_variables/variable_is_lowercase_spec.rb +1 -1
- data/spec/puppet-lint/plugins/check_whitespace/140chars_spec.rb +22 -15
- data/spec/puppet-lint/plugins/check_whitespace/2sp_soft_tabs_spec.rb +8 -6
- data/spec/puppet-lint/plugins/check_whitespace/80chars_spec.rb +23 -29
- data/spec/puppet-lint/plugins/check_whitespace/arrow_alignment_spec.rb +588 -494
- data/spec/puppet-lint/plugins/check_whitespace/hard_tabs_spec.rb +1 -1
- data/spec/puppet-lint/plugins/check_whitespace/trailing_whitespace_spec.rb +27 -19
- data/spec/puppet-lint_spec.rb +2 -12
- data/spec/spec_helper.rb +35 -30
- metadata +6 -5
- data/lib/puppet-lint/monkeypatches.rb +0 -2
- data/lib/puppet-lint/monkeypatches/string_percent.rb +0 -52
- data/lib/puppet-lint/monkeypatches/string_prepend.rb +0 -13
@@ -141,26 +141,28 @@ describe 'file_mode' do
|
|
141
141
|
end
|
142
142
|
|
143
143
|
context 'multi body file bad modes selector' do
|
144
|
-
let(:code)
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
144
|
+
let(:code) do
|
145
|
+
<<-END
|
146
|
+
file {
|
147
|
+
'/tmp/foo1':
|
148
|
+
ensure => $foo ? { default => absent },
|
149
|
+
mode => 644;
|
150
|
+
'/tmp/foo2':
|
151
|
+
mode => 644;
|
152
|
+
'/tmp/foo3':
|
153
|
+
mode => 644;
|
154
|
+
}
|
155
|
+
END
|
156
|
+
end
|
155
157
|
|
156
158
|
it 'should detect 3 problems' do
|
157
159
|
expect(problems).to have(3).problems
|
158
160
|
end
|
159
161
|
|
160
162
|
it 'should create three warnings' do
|
161
|
-
expect(problems).to contain_warning(sprintf(msg)).on_line(
|
162
|
-
expect(problems).to contain_warning(sprintf(msg)).on_line(
|
163
|
-
expect(problems).to contain_warning(sprintf(msg)).on_line(
|
163
|
+
expect(problems).to contain_warning(sprintf(msg)).on_line(4).in_column(23)
|
164
|
+
expect(problems).to contain_warning(sprintf(msg)).on_line(6).in_column(23)
|
165
|
+
expect(problems).to contain_warning(sprintf(msg)).on_line(8).in_column(23)
|
164
166
|
end
|
165
167
|
end
|
166
168
|
end
|
@@ -251,38 +253,42 @@ describe 'file_mode' do
|
|
251
253
|
end
|
252
254
|
|
253
255
|
context 'multi body file bad modes selector' do
|
254
|
-
let(:code)
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
256
|
+
let(:code) do
|
257
|
+
<<-END
|
258
|
+
file {
|
259
|
+
'/tmp/foo1':
|
260
|
+
ensure => $foo ? { default => absent },
|
261
|
+
mode => 644;
|
262
|
+
'/tmp/foo2':
|
263
|
+
mode => 644;
|
264
|
+
'/tmp/foo3':
|
265
|
+
mode => 644;
|
266
|
+
}
|
267
|
+
END
|
268
|
+
end
|
269
|
+
|
270
|
+
let(:fixed) do
|
271
|
+
<<-END
|
272
|
+
file {
|
273
|
+
'/tmp/foo1':
|
274
|
+
ensure => $foo ? { default => absent },
|
275
|
+
mode => '0644';
|
276
|
+
'/tmp/foo2':
|
277
|
+
mode => '0644';
|
278
|
+
'/tmp/foo3':
|
279
|
+
mode => '0644';
|
280
|
+
}
|
281
|
+
END
|
282
|
+
end
|
277
283
|
|
278
284
|
it 'should detect 3 problems' do
|
279
285
|
expect(problems).to have(3).problems
|
280
286
|
end
|
281
287
|
|
282
288
|
it 'should fix 3 problems' do
|
283
|
-
expect(problems).to contain_fixed(msg).on_line(
|
284
|
-
expect(problems).to contain_fixed(msg).on_line(
|
285
|
-
expect(problems).to contain_fixed(msg).on_line(
|
289
|
+
expect(problems).to contain_fixed(msg).on_line(4).in_column(23)
|
290
|
+
expect(problems).to contain_fixed(msg).on_line(6).in_column(23)
|
291
|
+
expect(problems).to contain_fixed(msg).on_line(8).in_column(23)
|
286
292
|
end
|
287
293
|
|
288
294
|
it 'should zero pad the file modes and change them to strings' do
|
@@ -37,26 +37,28 @@ describe 'unquoted_file_mode' do
|
|
37
37
|
end
|
38
38
|
|
39
39
|
context 'multi body file bad modes selector' do
|
40
|
-
let(:code)
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
40
|
+
let(:code) do
|
41
|
+
<<-END
|
42
|
+
file {
|
43
|
+
'/tmp/foo1':
|
44
|
+
ensure => $foo ? { default => absent },
|
45
|
+
mode => 644;
|
46
|
+
'/tmp/foo2':
|
47
|
+
mode => 644;
|
48
|
+
'/tmp/foo3':
|
49
|
+
mode => 644;
|
50
|
+
}
|
51
|
+
END
|
52
|
+
end
|
51
53
|
|
52
54
|
it 'should detect 3 problems' do
|
53
55
|
expect(problems).to have(3).problems
|
54
56
|
end
|
55
57
|
|
56
58
|
it 'should create three warnings' do
|
57
|
-
expect(problems).to contain_warning(sprintf(msg)).on_line(
|
58
|
-
expect(problems).to contain_warning(sprintf(msg)).on_line(
|
59
|
-
expect(problems).to contain_warning(sprintf(msg)).on_line(
|
59
|
+
expect(problems).to contain_warning(sprintf(msg)).on_line(4).in_column(23)
|
60
|
+
expect(problems).to contain_warning(sprintf(msg)).on_line(6).in_column(23)
|
61
|
+
expect(problems).to contain_warning(sprintf(msg)).on_line(8).in_column(23)
|
60
62
|
end
|
61
63
|
end
|
62
64
|
end
|
@@ -115,38 +117,42 @@ describe 'unquoted_file_mode' do
|
|
115
117
|
end
|
116
118
|
|
117
119
|
context 'multi body file bad modes selector' do
|
118
|
-
let(:code)
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
120
|
+
let(:code) do
|
121
|
+
<<-END
|
122
|
+
file {
|
123
|
+
'/tmp/foo1':
|
124
|
+
ensure => $foo ? { default => absent },
|
125
|
+
mode => 644;
|
126
|
+
'/tmp/foo2':
|
127
|
+
mode => 644;
|
128
|
+
'/tmp/foo3':
|
129
|
+
mode => 644;
|
130
|
+
}
|
131
|
+
END
|
132
|
+
end
|
133
|
+
|
134
|
+
let(:fixed) do
|
135
|
+
<<-END
|
136
|
+
file {
|
137
|
+
'/tmp/foo1':
|
138
|
+
ensure => $foo ? { default => absent },
|
139
|
+
mode => '644';
|
140
|
+
'/tmp/foo2':
|
141
|
+
mode => '644';
|
142
|
+
'/tmp/foo3':
|
143
|
+
mode => '644';
|
144
|
+
}
|
145
|
+
END
|
146
|
+
end
|
141
147
|
|
142
148
|
it 'should detect 3 problems' do
|
143
149
|
expect(problems).to have(3).problems
|
144
150
|
end
|
145
151
|
|
146
152
|
it 'should fix 3 problems' do
|
147
|
-
expect(problems).to contain_fixed(msg).on_line(
|
148
|
-
expect(problems).to contain_fixed(msg).on_line(
|
149
|
-
expect(problems).to contain_fixed(msg).on_line(
|
153
|
+
expect(problems).to contain_fixed(msg).on_line(4).in_column(23)
|
154
|
+
expect(problems).to contain_fixed(msg).on_line(6).in_column(23)
|
155
|
+
expect(problems).to contain_fixed(msg).on_line(8).in_column(23)
|
150
156
|
end
|
151
157
|
|
152
158
|
it 'should quote the file modes' do
|
@@ -13,7 +13,7 @@ describe 'unquoted_resource_title' do
|
|
13
13
|
end
|
14
14
|
|
15
15
|
context 'unquoted resource title on single line resource' do
|
16
|
-
let(:code) {
|
16
|
+
let(:code) { 'file { foo: }' }
|
17
17
|
|
18
18
|
it 'should only detect a single problem' do
|
19
19
|
expect(problems).to have(1).problem
|
@@ -25,10 +25,12 @@ describe 'unquoted_resource_title' do
|
|
25
25
|
end
|
26
26
|
|
27
27
|
context 'quoted resource title on multi line resource' do
|
28
|
-
let(:code)
|
29
|
-
|
30
|
-
|
31
|
-
|
28
|
+
let(:code) do
|
29
|
+
<<-END
|
30
|
+
file { 'foo':
|
31
|
+
}
|
32
|
+
END
|
33
|
+
end
|
32
34
|
|
33
35
|
it 'should not detect any problems' do
|
34
36
|
expect(problems).to have(0).problems
|
@@ -36,27 +38,31 @@ describe 'unquoted_resource_title' do
|
|
36
38
|
end
|
37
39
|
|
38
40
|
context 'unquoted resource title on multi line resource' do
|
39
|
-
let(:code)
|
40
|
-
|
41
|
-
|
42
|
-
|
41
|
+
let(:code) do
|
42
|
+
<<-END
|
43
|
+
file { foo:
|
44
|
+
}
|
45
|
+
END
|
46
|
+
end
|
43
47
|
|
44
48
|
it 'should only detect a single problem' do
|
45
49
|
expect(problems).to have(1).problem
|
46
50
|
end
|
47
51
|
|
48
52
|
it 'should create a warning' do
|
49
|
-
expect(problems).to contain_warning(msg).on_line(
|
53
|
+
expect(problems).to contain_warning(msg).on_line(1).in_column(18)
|
50
54
|
end
|
51
55
|
end
|
52
56
|
|
53
57
|
context 'condensed resources with quoted titles' do
|
54
|
-
let(:code)
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
58
|
+
let(:code) do
|
59
|
+
<<-END
|
60
|
+
file {
|
61
|
+
'foo': ;
|
62
|
+
'bar': ;
|
63
|
+
}
|
64
|
+
END
|
65
|
+
end
|
60
66
|
|
61
67
|
it 'should not detect any problems' do
|
62
68
|
expect(problems).to have(0).problems
|
@@ -64,19 +70,21 @@ describe 'unquoted_resource_title' do
|
|
64
70
|
end
|
65
71
|
|
66
72
|
context 'condensed resources with an unquoted title' do
|
67
|
-
let(:code)
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
+
let(:code) do
|
74
|
+
<<-END
|
75
|
+
file {
|
76
|
+
'foo': ;
|
77
|
+
bar: ;
|
78
|
+
}
|
79
|
+
END
|
80
|
+
end
|
73
81
|
|
74
82
|
it 'should only detect a single problem' do
|
75
83
|
expect(problems).to have(1).problem
|
76
84
|
end
|
77
85
|
|
78
86
|
it 'should create a warning' do
|
79
|
-
expect(problems).to contain_warning(msg).on_line(
|
87
|
+
expect(problems).to contain_warning(msg).on_line(3).in_column(13)
|
80
88
|
end
|
81
89
|
end
|
82
90
|
|
@@ -89,15 +97,17 @@ describe 'unquoted_resource_title' do
|
|
89
97
|
end
|
90
98
|
|
91
99
|
context 'resource inside a case statement' do
|
92
|
-
let(:code)
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
100
|
+
let(:code) do
|
101
|
+
<<-END
|
102
|
+
case $ensure {
|
103
|
+
'absent': {
|
104
|
+
file { "some_file_${name}":
|
105
|
+
ensure => absent,
|
106
|
+
}
|
97
107
|
}
|
98
108
|
}
|
99
|
-
|
100
|
-
|
109
|
+
END
|
110
|
+
end
|
101
111
|
|
102
112
|
it 'should not detect any problems' do
|
103
113
|
expect(problems).to have(0).problems
|
@@ -105,12 +115,14 @@ describe 'unquoted_resource_title' do
|
|
105
115
|
end
|
106
116
|
|
107
117
|
context 'issue #116' do
|
108
|
-
let(:code)
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
118
|
+
let(:code) do
|
119
|
+
<<-END
|
120
|
+
$config_file_init = $::operatingsystem ? {
|
121
|
+
/(?i:Debian|Ubuntu|Mint)/ => '/etc/default/foo',
|
122
|
+
default => '/etc/sysconfig/foo',
|
123
|
+
}
|
124
|
+
END
|
125
|
+
end
|
114
126
|
|
115
127
|
it 'should not detect any problems' do
|
116
128
|
expect(problems).to have(0).problems
|
@@ -118,19 +130,21 @@ describe 'unquoted_resource_title' do
|
|
118
130
|
end
|
119
131
|
|
120
132
|
context 'case statement' do
|
121
|
-
let(:code)
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
133
|
+
let(:code) do
|
134
|
+
<<-END
|
135
|
+
case $operatingsystem {
|
136
|
+
centos: {
|
137
|
+
$version = '1.2.3'
|
138
|
+
}
|
139
|
+
solaris: {
|
140
|
+
$version = '3.2.1'
|
141
|
+
}
|
142
|
+
default: {
|
143
|
+
fail("Module ${module_name} is not supported on ${operatingsystem}")
|
144
|
+
}
|
131
145
|
}
|
132
|
-
|
133
|
-
|
146
|
+
END
|
147
|
+
end
|
134
148
|
|
135
149
|
it 'should not detect any problems' do
|
136
150
|
expect(problems).to have(0).problems
|
@@ -148,7 +162,7 @@ describe 'unquoted_resource_title' do
|
|
148
162
|
end
|
149
163
|
|
150
164
|
context 'unquoted resource title on single line resource' do
|
151
|
-
let(:code) {
|
165
|
+
let(:code) { 'file { foo: }' }
|
152
166
|
|
153
167
|
it 'should only detect a single problem' do
|
154
168
|
expect(problems).to have(1).problem
|
@@ -164,21 +178,26 @@ describe 'unquoted_resource_title' do
|
|
164
178
|
end
|
165
179
|
|
166
180
|
context 'unquoted resource title on multi line resource' do
|
167
|
-
let(:code)
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
181
|
+
let(:code) do
|
182
|
+
<<-END
|
183
|
+
file { foo:
|
184
|
+
}
|
185
|
+
END
|
186
|
+
end
|
187
|
+
|
188
|
+
let(:fixed) do
|
189
|
+
<<-END
|
190
|
+
file { 'foo':
|
191
|
+
}
|
192
|
+
END
|
193
|
+
end
|
175
194
|
|
176
195
|
it 'should only detect a single problem' do
|
177
196
|
expect(problems).to have(1).problem
|
178
197
|
end
|
179
198
|
|
180
199
|
it 'should fix the manifest' do
|
181
|
-
expect(problems).to contain_fixed(msg).on_line(
|
200
|
+
expect(problems).to contain_fixed(msg).on_line(1).in_column(18)
|
182
201
|
end
|
183
202
|
|
184
203
|
it 'should single quote the resource title' do
|
@@ -187,25 +206,30 @@ describe 'unquoted_resource_title' do
|
|
187
206
|
end
|
188
207
|
|
189
208
|
context 'condensed resources with an unquoted title' do
|
190
|
-
let(:code)
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
209
|
+
let(:code) do
|
210
|
+
<<-END
|
211
|
+
file {
|
212
|
+
'foo': ;
|
213
|
+
bar: ;
|
214
|
+
}
|
215
|
+
END
|
216
|
+
end
|
217
|
+
|
218
|
+
let(:fixed) do
|
219
|
+
<<-END
|
220
|
+
file {
|
221
|
+
'foo': ;
|
222
|
+
'bar': ;
|
223
|
+
}
|
224
|
+
END
|
225
|
+
end
|
202
226
|
|
203
227
|
it 'should only detect a single problem' do
|
204
228
|
expect(problems).to have(1).problem
|
205
229
|
end
|
206
230
|
|
207
231
|
it 'should fix the manifest' do
|
208
|
-
expect(problems).to contain_fixed(msg).on_line(
|
232
|
+
expect(problems).to contain_fixed(msg).on_line(3).in_column(13)
|
209
233
|
end
|
210
234
|
|
211
235
|
it 'should single quote the resource title' do
|