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.
- checksums.yaml +4 -4
- data/README.md +18 -4
- data/lib/puppet-lint/lexer.rb +2 -2
- data/lib/puppet-lint/plugins/legacy_facts/legacy_facts.rb +2 -2
- data/lib/puppet-lint/plugins/top_scope_facts/top_scope_facts.rb +4 -4
- data/lib/puppet-lint/version.rb +1 -1
- data/rubocop_baseline.yml +7 -0
- data/spec/spec_helper.rb +0 -1
- data/spec/unit/puppet-lint/checks_spec.rb +7 -2
- data/spec/unit/puppet-lint/ignore_overrides_spec.rb +6 -6
- data/spec/unit/puppet-lint/lexer_spec.rb +702 -699
- data/spec/unit/puppet-lint/plugins/check_classes/arrow_on_right_operand_line_spec.rb +5 -5
- data/spec/unit/puppet-lint/plugins/check_classes/autoloader_layout_spec.rb +8 -8
- data/spec/unit/puppet-lint/plugins/check_classes/class_inherits_from_params_class_spec.rb +2 -2
- data/spec/unit/puppet-lint/plugins/check_classes/code_on_top_scope_spec.rb +2 -1
- data/spec/unit/puppet-lint/plugins/check_classes/inherits_across_namespaces_spec.rb +3 -3
- data/spec/unit/puppet-lint/plugins/check_classes/name_contains_uppercase_spec.rb +3 -3
- data/spec/unit/puppet-lint/plugins/check_classes/names_containing_dash_spec.rb +3 -3
- data/spec/unit/puppet-lint/plugins/check_classes/nested_classes_or_defines_spec.rb +5 -5
- data/spec/unit/puppet-lint/plugins/check_classes/parameter_order_spec.rb +14 -14
- data/spec/unit/puppet-lint/plugins/check_classes/right_to_left_relationship_spec.rb +2 -2
- data/spec/unit/puppet-lint/plugins/check_classes/variable_scope_spec.rb +21 -21
- data/spec/unit/puppet-lint/plugins/check_comments/slash_comments_spec.rb +2 -2
- data/spec/unit/puppet-lint/plugins/check_comments/star_comments_spec.rb +4 -4
- data/spec/unit/puppet-lint/plugins/check_conditionals/case_without_default_spec.rb +6 -6
- data/spec/unit/puppet-lint/plugins/check_conditionals/selector_inside_resource_spec.rb +2 -2
- data/spec/unit/puppet-lint/plugins/check_documentation/documentation_spec.rb +5 -5
- data/spec/unit/puppet-lint/plugins/check_nodes/unquoted_node_name_spec.rb +11 -11
- data/spec/unit/puppet-lint/plugins/check_resources/duplicate_params_spec.rb +6 -6
- data/spec/unit/puppet-lint/plugins/check_resources/ensure_first_param_spec.rb +12 -12
- data/spec/unit/puppet-lint/plugins/check_resources/ensure_not_symlink_target_spec.rb +4 -4
- data/spec/unit/puppet-lint/plugins/check_resources/file_mode_spec.rb +22 -22
- data/spec/unit/puppet-lint/plugins/check_resources/unquoted_file_mode_spec.rb +8 -8
- data/spec/unit/puppet-lint/plugins/check_resources/unquoted_resource_title_spec.rb +13 -13
- data/spec/unit/puppet-lint/plugins/check_strings/double_quoted_strings_spec.rb +18 -18
- data/spec/unit/puppet-lint/plugins/check_strings/only_variable_string_spec.rb +6 -6
- data/spec/unit/puppet-lint/plugins/check_strings/puppet_url_without_modules_spec.rb +4 -4
- data/spec/unit/puppet-lint/plugins/check_strings/quoted_booleans_spec.rb +8 -8
- data/spec/unit/puppet-lint/plugins/check_strings/single_quote_string_with_variables_spec.rb +3 -3
- data/spec/unit/puppet-lint/plugins/check_strings/variables_not_enclosed_spec.rb +7 -7
- data/spec/unit/puppet-lint/plugins/check_variables/variable_contains_dash_spec.rb +2 -2
- data/spec/unit/puppet-lint/plugins/check_variables/variable_is_lowercase_spec.rb +5 -5
- data/spec/unit/puppet-lint/plugins/check_whitespace/140chars_spec.rb +4 -4
- data/spec/unit/puppet-lint/plugins/check_whitespace/2sp_soft_tabs_spec.rb +1 -1
- data/spec/unit/puppet-lint/plugins/check_whitespace/80chars_spec.rb +4 -4
- data/spec/unit/puppet-lint/plugins/check_whitespace/arrow_alignment_spec.rb +37 -37
- data/spec/unit/puppet-lint/plugins/check_whitespace/hard_tabs_spec.rb +2 -2
- data/spec/unit/puppet-lint/plugins/check_whitespace/trailing_whitespace_spec.rb +6 -6
- data/spec/unit/puppet-lint/plugins/legacy_facts/legacy_facts_spec.rb +83 -75
- data/spec/unit/puppet-lint/plugins/top_scope_facts/top_scope_facts_spec.rb +19 -19
- metadata +6 -4
@@ -78,12 +78,13 @@ describe PuppetLint::Lexer do
|
|
78
78
|
end
|
79
79
|
|
80
80
|
it 'creates a :STRING token' do
|
81
|
-
expect(tokens).to
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
81
|
+
expect(tokens).to contain_exactly(
|
82
|
+
have_attributes(
|
83
|
+
type: :STRING,
|
84
|
+
value: '',
|
85
|
+
line: 1,
|
86
|
+
column: 1,
|
87
|
+
),
|
87
88
|
)
|
88
89
|
end
|
89
90
|
|
@@ -102,24 +103,25 @@ describe PuppetLint::Lexer do
|
|
102
103
|
end
|
103
104
|
|
104
105
|
it 'creates a tokenised string with an interpolated variable' do
|
105
|
-
expect(tokens).to
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
106
|
+
expect(tokens).to contain_exactly(
|
107
|
+
have_attributes(
|
108
|
+
type: :DQPRE,
|
109
|
+
value: '',
|
110
|
+
line: 1,
|
111
|
+
column: 1,
|
112
|
+
),
|
113
|
+
have_attributes(
|
114
|
+
type: :VARIABLE,
|
115
|
+
value: 'foo',
|
116
|
+
line: 1,
|
117
|
+
column: 4,
|
118
|
+
),
|
119
|
+
have_attributes(
|
120
|
+
type: :DQPOST,
|
121
|
+
value: 'bar',
|
122
|
+
line: 1,
|
123
|
+
column: 7,
|
124
|
+
),
|
123
125
|
)
|
124
126
|
end
|
125
127
|
|
@@ -138,24 +140,25 @@ describe PuppetLint::Lexer do
|
|
138
140
|
end
|
139
141
|
|
140
142
|
it 'creates a tokenised string with an interpolated variable' do
|
141
|
-
expect(tokens).to
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
143
|
+
expect(tokens).to contain_exactly(
|
144
|
+
have_attributes(
|
145
|
+
type: :DQPRE,
|
146
|
+
value: 'foo',
|
147
|
+
line: 1,
|
148
|
+
column: 1,
|
149
|
+
),
|
150
|
+
have_attributes(
|
151
|
+
type: :VARIABLE,
|
152
|
+
value: 'bar',
|
153
|
+
line: 1,
|
154
|
+
column: 7,
|
155
|
+
),
|
156
|
+
have_attributes(
|
157
|
+
type: :DQPOST,
|
158
|
+
value: 'baz',
|
159
|
+
line: 1,
|
160
|
+
column: 10,
|
161
|
+
),
|
159
162
|
)
|
160
163
|
end
|
161
164
|
|
@@ -176,37 +179,37 @@ describe PuppetLint::Lexer do
|
|
176
179
|
end
|
177
180
|
|
178
181
|
it 'creates a tokenised string with the interpolated variables' do
|
179
|
-
expect(tokens).to
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
182
|
+
expect(tokens).to contain_exactly(
|
183
|
+
have_attributes(
|
184
|
+
type: :DQPRE,
|
185
|
+
value: 'foo',
|
186
|
+
line: 1,
|
187
|
+
column: 1,
|
188
|
+
),
|
189
|
+
have_attributes(
|
190
|
+
type: :VARIABLE,
|
191
|
+
value: 'bar',
|
192
|
+
line: 1,
|
193
|
+
column: 7,
|
194
|
+
),
|
195
|
+
have_attributes(
|
196
|
+
type: :DQMID,
|
197
|
+
value: 'baz',
|
198
|
+
line: 1,
|
199
|
+
column: 10,
|
200
|
+
),
|
201
|
+
have_attributes(
|
202
|
+
type: :VARIABLE,
|
203
|
+
value: 'gronk',
|
204
|
+
line: 1,
|
205
|
+
column: 16,
|
206
|
+
),
|
207
|
+
have_attributes(
|
208
|
+
type: :DQPOST,
|
209
|
+
value: 'meh',
|
210
|
+
line: 1,
|
211
|
+
column: 21,
|
212
|
+
),
|
210
213
|
)
|
211
214
|
end
|
212
215
|
|
@@ -225,25 +228,25 @@ describe PuppetLint::Lexer do
|
|
225
228
|
end
|
226
229
|
|
227
230
|
it 'creates a tokenised string' do
|
228
|
-
expect(tokens).to
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
231
|
+
expect(tokens).to contain_exactly(
|
232
|
+
have_attributes(
|
233
|
+
type: :DQPRE,
|
234
|
+
value: '',
|
235
|
+
line: 1,
|
236
|
+
column: 1,
|
237
|
+
),
|
238
|
+
have_attributes(
|
239
|
+
type: :VARIABLE,
|
240
|
+
value: 'foo',
|
241
|
+
line: 1,
|
242
|
+
column: 4,
|
243
|
+
),
|
244
|
+
have_attributes(
|
245
|
+
type: :DQPOST,
|
246
|
+
value: '',
|
247
|
+
line: 1,
|
248
|
+
column: 7,
|
249
|
+
),
|
247
250
|
)
|
248
251
|
end
|
249
252
|
|
@@ -264,25 +267,25 @@ describe PuppetLint::Lexer do
|
|
264
267
|
end
|
265
268
|
|
266
269
|
it 'creates a tokenised string' do
|
267
|
-
expect(tokens).to
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
270
|
+
expect(tokens).to contain_exactly(
|
271
|
+
have_attributes(
|
272
|
+
type: :DQPRE,
|
273
|
+
value: '',
|
274
|
+
line: 1,
|
275
|
+
column: 1,
|
276
|
+
),
|
277
|
+
have_attributes(
|
278
|
+
type: :VARIABLE,
|
279
|
+
value: keyword,
|
280
|
+
line: 1,
|
281
|
+
column: 4,
|
282
|
+
),
|
283
|
+
have_attributes(
|
284
|
+
type: :DQPOST,
|
285
|
+
value: '',
|
286
|
+
line: 1,
|
287
|
+
column: keyword.size + 4,
|
288
|
+
),
|
286
289
|
)
|
287
290
|
end
|
288
291
|
|
@@ -303,25 +306,25 @@ describe PuppetLint::Lexer do
|
|
303
306
|
end
|
304
307
|
|
305
308
|
it 'creates a tokenised string' do
|
306
|
-
expect(tokens).to
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
309
|
+
expect(tokens).to contain_exactly(
|
310
|
+
have_attributes(
|
311
|
+
type: :DQPRE,
|
312
|
+
value: '',
|
313
|
+
line: 1,
|
314
|
+
column: 1,
|
315
|
+
),
|
316
|
+
have_attributes(
|
317
|
+
type: :VARIABLE,
|
318
|
+
value: 'bar',
|
319
|
+
line: 1,
|
320
|
+
column: 4,
|
321
|
+
),
|
322
|
+
have_attributes(
|
323
|
+
type: :DQPOST,
|
324
|
+
value: '',
|
325
|
+
line: 1,
|
326
|
+
column: 8,
|
327
|
+
),
|
325
328
|
)
|
326
329
|
end
|
327
330
|
|
@@ -340,61 +343,61 @@ describe PuppetLint::Lexer do
|
|
340
343
|
end
|
341
344
|
|
342
345
|
it 'creates a tokenised string' do
|
343
|
-
expect(tokens).to
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
346
|
+
expect(tokens).to contain_exactly(
|
347
|
+
have_attributes(
|
348
|
+
type: :DQPRE,
|
349
|
+
value: '',
|
350
|
+
line: 1,
|
351
|
+
column: 1,
|
352
|
+
),
|
353
|
+
have_attributes(
|
354
|
+
type: :VARIABLE,
|
355
|
+
value: 'foo',
|
356
|
+
line: 1,
|
357
|
+
column: 4,
|
358
|
+
),
|
359
|
+
have_attributes(
|
360
|
+
type: :LBRACK,
|
361
|
+
value: '[',
|
362
|
+
line: 1,
|
363
|
+
column: 7,
|
364
|
+
),
|
365
|
+
have_attributes(
|
366
|
+
type: :NAME,
|
367
|
+
value: 'bar',
|
368
|
+
line: 1,
|
369
|
+
column: 8,
|
370
|
+
),
|
371
|
+
have_attributes(
|
372
|
+
type: :RBRACK,
|
373
|
+
value: ']',
|
374
|
+
line: 1,
|
375
|
+
column: 11,
|
376
|
+
),
|
377
|
+
have_attributes(
|
378
|
+
type: :LBRACK,
|
379
|
+
value: '[',
|
380
|
+
line: 1,
|
381
|
+
column: 12,
|
382
|
+
),
|
383
|
+
have_attributes(
|
384
|
+
type: :NAME,
|
385
|
+
value: 'baz',
|
386
|
+
line: 1,
|
387
|
+
column: 13,
|
388
|
+
),
|
389
|
+
have_attributes(
|
390
|
+
type: :RBRACK,
|
391
|
+
value: ']',
|
392
|
+
line: 1,
|
393
|
+
column: 16,
|
394
|
+
),
|
395
|
+
have_attributes(
|
396
|
+
type: :DQPOST,
|
397
|
+
value: '',
|
398
|
+
line: 1,
|
399
|
+
column: 17,
|
400
|
+
),
|
398
401
|
)
|
399
402
|
end
|
400
403
|
|
@@ -415,37 +418,37 @@ describe PuppetLint::Lexer do
|
|
415
418
|
end
|
416
419
|
|
417
420
|
it 'creates a tokenised string' do
|
418
|
-
expect(tokens).to
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
421
|
+
expect(tokens).to contain_exactly(
|
422
|
+
have_attributes(
|
423
|
+
type: :DQPRE,
|
424
|
+
value: '',
|
425
|
+
line: 1,
|
426
|
+
column: 1,
|
427
|
+
),
|
428
|
+
have_attributes(
|
429
|
+
type: :VARIABLE,
|
430
|
+
value: 'foo',
|
431
|
+
line: 1,
|
432
|
+
column: 4,
|
433
|
+
),
|
434
|
+
have_attributes(
|
435
|
+
type: :DQMID,
|
436
|
+
value: '',
|
437
|
+
line: 1,
|
438
|
+
column: 7,
|
439
|
+
),
|
440
|
+
have_attributes(
|
441
|
+
type: :VARIABLE,
|
442
|
+
value: 'bar',
|
443
|
+
line: 1,
|
444
|
+
column: 10,
|
445
|
+
),
|
446
|
+
have_attributes(
|
447
|
+
type: :DQPOST,
|
448
|
+
value: '',
|
449
|
+
line: 1,
|
450
|
+
column: 13,
|
451
|
+
),
|
449
452
|
)
|
450
453
|
end
|
451
454
|
|
@@ -464,25 +467,25 @@ describe PuppetLint::Lexer do
|
|
464
467
|
end
|
465
468
|
|
466
469
|
it 'creates a tokenised string' do
|
467
|
-
expect(tokens).to
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
470
|
+
expect(tokens).to contain_exactly(
|
471
|
+
have_attributes(
|
472
|
+
type: :DQPRE,
|
473
|
+
value: '',
|
474
|
+
line: 1,
|
475
|
+
column: 1,
|
476
|
+
),
|
477
|
+
have_attributes(
|
478
|
+
type: :UNENC_VARIABLE,
|
479
|
+
value: 'foo',
|
480
|
+
line: 1,
|
481
|
+
column: 2,
|
482
|
+
),
|
483
|
+
have_attributes(
|
484
|
+
type: :DQPOST,
|
485
|
+
value: '',
|
486
|
+
line: 1,
|
487
|
+
column: 6,
|
488
|
+
),
|
486
489
|
)
|
487
490
|
end
|
488
491
|
|
@@ -501,25 +504,25 @@ describe PuppetLint::Lexer do
|
|
501
504
|
end
|
502
505
|
|
503
506
|
it 'creates a tokenised string' do
|
504
|
-
expect(tokens).to
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
507
|
+
expect(tokens).to contain_exactly(
|
508
|
+
have_attributes(
|
509
|
+
type: :DQPRE,
|
510
|
+
value: 'string with ',
|
511
|
+
line: 1,
|
512
|
+
column: 1,
|
513
|
+
),
|
514
|
+
have_attributes(
|
515
|
+
type: :SSTRING,
|
516
|
+
value: 'a nested single quoted string',
|
517
|
+
line: 1,
|
518
|
+
column: 16,
|
519
|
+
),
|
520
|
+
have_attributes(
|
521
|
+
type: :DQPOST,
|
522
|
+
value: ' inside it',
|
523
|
+
line: 1,
|
524
|
+
column: 47,
|
525
|
+
),
|
523
526
|
)
|
524
527
|
end
|
525
528
|
|
@@ -538,61 +541,61 @@ describe PuppetLint::Lexer do
|
|
538
541
|
end
|
539
542
|
|
540
543
|
it 'creates a tokenised string' do
|
541
|
-
expect(tokens).to
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
544
|
+
expect(tokens).to contain_exactly(
|
545
|
+
have_attributes(
|
546
|
+
type: :DQPRE,
|
547
|
+
value: 'string with ',
|
548
|
+
line: 1,
|
549
|
+
column: 1,
|
550
|
+
),
|
551
|
+
have_attributes(
|
552
|
+
type: :LPAREN,
|
553
|
+
value: '(',
|
554
|
+
line: 1,
|
555
|
+
column: 16,
|
556
|
+
),
|
557
|
+
have_attributes(
|
558
|
+
type: :NUMBER,
|
559
|
+
value: '3',
|
560
|
+
line: 1,
|
561
|
+
column: 17,
|
562
|
+
),
|
563
|
+
have_attributes(
|
564
|
+
type: :PLUS,
|
565
|
+
value: '+',
|
566
|
+
line: 1,
|
567
|
+
column: 18,
|
568
|
+
),
|
569
|
+
have_attributes(
|
570
|
+
type: :NUMBER,
|
571
|
+
value: '5',
|
572
|
+
line: 1,
|
573
|
+
column: 19,
|
574
|
+
),
|
575
|
+
have_attributes(
|
576
|
+
type: :RPAREN,
|
577
|
+
value: ')',
|
578
|
+
line: 1,
|
579
|
+
column: 20,
|
580
|
+
),
|
581
|
+
have_attributes(
|
582
|
+
type: :DIV,
|
583
|
+
value: '/',
|
584
|
+
line: 1,
|
585
|
+
column: 21,
|
586
|
+
),
|
587
|
+
have_attributes(
|
588
|
+
type: :NUMBER,
|
589
|
+
value: '4',
|
590
|
+
line: 1,
|
591
|
+
column: 22,
|
592
|
+
),
|
593
|
+
have_attributes(
|
594
|
+
type: :DQPOST,
|
595
|
+
value: ' nested math',
|
596
|
+
line: 1,
|
597
|
+
column: 23,
|
598
|
+
),
|
596
599
|
)
|
597
600
|
end
|
598
601
|
|
@@ -611,55 +614,55 @@ describe PuppetLint::Lexer do
|
|
611
614
|
end
|
612
615
|
|
613
616
|
it 'creates a tokenised string' do
|
614
|
-
expect(tokens).to
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
617
|
+
expect(tokens).to contain_exactly(
|
618
|
+
have_attributes(
|
619
|
+
type: :DQPRE,
|
620
|
+
value: 'string with ',
|
621
|
+
line: 1,
|
622
|
+
column: 1,
|
623
|
+
),
|
624
|
+
have_attributes(
|
625
|
+
type: :LBRACK,
|
626
|
+
value: '[',
|
627
|
+
line: 1,
|
628
|
+
column: 16,
|
629
|
+
),
|
630
|
+
have_attributes(
|
631
|
+
type: :SSTRING,
|
632
|
+
value: 'an array ',
|
633
|
+
line: 1,
|
634
|
+
column: 17,
|
635
|
+
),
|
636
|
+
have_attributes(
|
637
|
+
type: :COMMA,
|
638
|
+
value: ',',
|
639
|
+
line: 1,
|
640
|
+
column: 28,
|
641
|
+
),
|
642
|
+
have_attributes(
|
643
|
+
type: :WHITESPACE,
|
644
|
+
value: ' ',
|
645
|
+
line: 1,
|
646
|
+
column: 29,
|
647
|
+
),
|
648
|
+
have_attributes(
|
649
|
+
type: :VARIABLE,
|
650
|
+
value: 'v2',
|
651
|
+
line: 1,
|
652
|
+
column: 30,
|
653
|
+
),
|
654
|
+
have_attributes(
|
655
|
+
type: :RBRACK,
|
656
|
+
value: ']',
|
657
|
+
line: 1,
|
658
|
+
column: 33,
|
659
|
+
),
|
660
|
+
have_attributes(
|
661
|
+
type: :DQPOST,
|
662
|
+
value: ' in it',
|
663
|
+
line: 1,
|
664
|
+
column: 34,
|
665
|
+
),
|
663
666
|
)
|
664
667
|
end
|
665
668
|
|
@@ -680,37 +683,37 @@ describe PuppetLint::Lexer do
|
|
680
683
|
end
|
681
684
|
|
682
685
|
it 'creates a tokenised string' do
|
683
|
-
expect(tokens).to
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
686
|
+
expect(tokens).to contain_exactly(
|
687
|
+
have_attributes(
|
688
|
+
type: :DQPRE,
|
689
|
+
value: '',
|
690
|
+
line: 1,
|
691
|
+
column: 1,
|
692
|
+
),
|
693
|
+
have_attributes(
|
694
|
+
type: :UNENC_VARIABLE,
|
695
|
+
value: 'foo',
|
696
|
+
line: 1,
|
697
|
+
column: 2,
|
698
|
+
),
|
699
|
+
have_attributes(
|
700
|
+
type: :DQMID,
|
701
|
+
value: '',
|
702
|
+
line: 1,
|
703
|
+
column: 6,
|
704
|
+
),
|
705
|
+
have_attributes(
|
706
|
+
type: :UNENC_VARIABLE,
|
707
|
+
value: 'bar',
|
708
|
+
line: 1,
|
709
|
+
column: 6,
|
710
|
+
),
|
711
|
+
have_attributes(
|
712
|
+
type: :DQPOST,
|
713
|
+
value: '',
|
714
|
+
line: 1,
|
715
|
+
column: 10,
|
716
|
+
),
|
714
717
|
)
|
715
718
|
end
|
716
719
|
|
@@ -729,25 +732,25 @@ describe PuppetLint::Lexer do
|
|
729
732
|
end
|
730
733
|
|
731
734
|
it 'creates a tokenised string' do
|
732
|
-
expect(tokens).to
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
735
|
+
expect(tokens).to contain_exactly(
|
736
|
+
have_attributes(
|
737
|
+
type: :DQPRE,
|
738
|
+
value: 'foo',
|
739
|
+
line: 1,
|
740
|
+
column: 1,
|
741
|
+
),
|
742
|
+
have_attributes(
|
743
|
+
type: :UNENC_VARIABLE,
|
744
|
+
value: 'bar',
|
745
|
+
line: 1,
|
746
|
+
column: 5,
|
747
|
+
),
|
748
|
+
have_attributes(
|
749
|
+
type: :DQPOST,
|
750
|
+
value: '$',
|
751
|
+
line: 1,
|
752
|
+
column: 9,
|
753
|
+
),
|
751
754
|
)
|
752
755
|
end
|
753
756
|
|
@@ -768,97 +771,97 @@ describe PuppetLint::Lexer do
|
|
768
771
|
end
|
769
772
|
|
770
773
|
it 'creates a tokenised string' do
|
771
|
-
expect(tokens).to
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
774
|
+
expect(tokens).to contain_exactly(
|
775
|
+
have_attributes(
|
776
|
+
type: :DQPRE,
|
777
|
+
value: '',
|
778
|
+
line: 1,
|
779
|
+
column: 1,
|
780
|
+
),
|
781
|
+
have_attributes(
|
782
|
+
type: :VARIABLE,
|
783
|
+
value: 'key',
|
784
|
+
line: 1,
|
785
|
+
column: 4,
|
786
|
+
),
|
787
|
+
have_attributes(
|
788
|
+
type: :DQMID,
|
789
|
+
value: ' ',
|
790
|
+
line: 1,
|
791
|
+
column: 7,
|
792
|
+
),
|
793
|
+
have_attributes(
|
794
|
+
type: :FUNCTION_NAME,
|
795
|
+
value: 'flatten',
|
796
|
+
line: 1,
|
797
|
+
column: 11,
|
798
|
+
),
|
799
|
+
have_attributes(
|
800
|
+
type: :LPAREN,
|
801
|
+
value: '(',
|
802
|
+
line: 1,
|
803
|
+
column: 18,
|
804
|
+
),
|
805
|
+
have_attributes(
|
806
|
+
type: :LBRACK,
|
807
|
+
value: '[',
|
808
|
+
line: 1,
|
809
|
+
column: 19,
|
810
|
+
),
|
811
|
+
have_attributes(
|
812
|
+
type: :VARIABLE,
|
813
|
+
value: 'value',
|
814
|
+
line: 1,
|
815
|
+
column: 20,
|
816
|
+
),
|
817
|
+
have_attributes(
|
818
|
+
type: :RBRACK,
|
819
|
+
value: ']',
|
820
|
+
line: 1,
|
821
|
+
column: 26,
|
822
|
+
),
|
823
|
+
have_attributes(
|
824
|
+
type: :RPAREN,
|
825
|
+
value: ')',
|
826
|
+
line: 1,
|
827
|
+
column: 27,
|
828
|
+
),
|
829
|
+
have_attributes(
|
830
|
+
type: :DOT,
|
831
|
+
value: '.',
|
832
|
+
line: 1,
|
833
|
+
column: 28,
|
834
|
+
),
|
835
|
+
have_attributes(
|
836
|
+
type: :FUNCTION_NAME,
|
837
|
+
value: 'join',
|
838
|
+
line: 1,
|
839
|
+
column: 29,
|
840
|
+
),
|
841
|
+
have_attributes(
|
842
|
+
type: :LPAREN,
|
843
|
+
value: '(',
|
844
|
+
line: 1,
|
845
|
+
column: 33,
|
846
|
+
),
|
847
|
+
have_attributes(
|
848
|
+
type: :STRING,
|
849
|
+
value: '\nkey ',
|
850
|
+
line: 1,
|
851
|
+
column: 34,
|
852
|
+
),
|
853
|
+
have_attributes(
|
854
|
+
type: :RPAREN,
|
855
|
+
value: ')',
|
856
|
+
line: 1,
|
857
|
+
column: 42,
|
858
|
+
),
|
859
|
+
have_attributes(
|
860
|
+
type: :DQPOST,
|
861
|
+
value: '',
|
862
|
+
line: 1,
|
863
|
+
column: 43,
|
864
|
+
),
|
862
865
|
)
|
863
866
|
end
|
864
867
|
|
@@ -879,97 +882,97 @@ describe PuppetLint::Lexer do
|
|
879
882
|
end
|
880
883
|
|
881
884
|
it 'creates a tokenised string' do
|
882
|
-
expect(tokens).to
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
|
952
|
-
|
953
|
-
|
954
|
-
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
968
|
-
|
969
|
-
|
970
|
-
|
971
|
-
|
972
|
-
|
885
|
+
expect(tokens).to contain_exactly(
|
886
|
+
have_attributes(
|
887
|
+
type: :DQPRE,
|
888
|
+
value: '',
|
889
|
+
line: 1,
|
890
|
+
column: 1,
|
891
|
+
),
|
892
|
+
have_attributes(
|
893
|
+
type: :VARIABLE,
|
894
|
+
value: 'facts',
|
895
|
+
line: 1,
|
896
|
+
column: 4,
|
897
|
+
),
|
898
|
+
have_attributes(
|
899
|
+
type: :LBRACK,
|
900
|
+
value: '[',
|
901
|
+
line: 1,
|
902
|
+
column: 9,
|
903
|
+
),
|
904
|
+
have_attributes(
|
905
|
+
type: :DQPRE,
|
906
|
+
value: 'network_',
|
907
|
+
line: 1,
|
908
|
+
column: 10,
|
909
|
+
),
|
910
|
+
have_attributes(
|
911
|
+
type: :VARIABLE,
|
912
|
+
value: 'iface',
|
913
|
+
line: 1,
|
914
|
+
column: 21,
|
915
|
+
),
|
916
|
+
have_attributes(
|
917
|
+
type: :DQPOST,
|
918
|
+
value: '',
|
919
|
+
line: 1,
|
920
|
+
column: 26,
|
921
|
+
),
|
922
|
+
have_attributes(
|
923
|
+
type: :RBRACK,
|
924
|
+
value: ']',
|
925
|
+
line: 1,
|
926
|
+
column: 28,
|
927
|
+
),
|
928
|
+
have_attributes(
|
929
|
+
type: :DQMID,
|
930
|
+
value: '/',
|
931
|
+
line: 1,
|
932
|
+
column: 29,
|
933
|
+
),
|
934
|
+
have_attributes(
|
935
|
+
type: :VARIABLE,
|
936
|
+
value: 'facts',
|
937
|
+
line: 1,
|
938
|
+
column: 33,
|
939
|
+
),
|
940
|
+
have_attributes(
|
941
|
+
type: :LBRACK,
|
942
|
+
value: '[',
|
943
|
+
line: 1,
|
944
|
+
column: 38,
|
945
|
+
),
|
946
|
+
have_attributes(
|
947
|
+
type: :DQPRE,
|
948
|
+
value: 'netmask_',
|
949
|
+
line: 1,
|
950
|
+
column: 39,
|
951
|
+
),
|
952
|
+
have_attributes(
|
953
|
+
type: :VARIABLE,
|
954
|
+
value: 'iface',
|
955
|
+
line: 1,
|
956
|
+
column: 50,
|
957
|
+
),
|
958
|
+
have_attributes(
|
959
|
+
type: :DQPOST,
|
960
|
+
value: '',
|
961
|
+
line: 1,
|
962
|
+
column: 55,
|
963
|
+
),
|
964
|
+
have_attributes(
|
965
|
+
type: :RBRACK,
|
966
|
+
value: ']',
|
967
|
+
line: 1,
|
968
|
+
column: 57,
|
969
|
+
),
|
970
|
+
have_attributes(
|
971
|
+
type: :DQPOST,
|
972
|
+
value: '',
|
973
|
+
line: 1,
|
974
|
+
column: 58,
|
975
|
+
),
|
973
976
|
)
|
974
977
|
end
|
975
978
|
|
@@ -988,115 +991,115 @@ describe PuppetLint::Lexer do
|
|
988
991
|
end
|
989
992
|
|
990
993
|
it 'creates a tokenised string' do
|
991
|
-
expect(tokens).to
|
992
|
-
|
993
|
-
|
994
|
-
|
995
|
-
|
996
|
-
|
997
|
-
|
998
|
-
|
999
|
-
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
|
1023
|
-
|
1024
|
-
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
1035
|
-
|
1036
|
-
|
1037
|
-
|
1038
|
-
|
1039
|
-
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1043
|
-
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1049
|
-
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1074
|
-
|
1075
|
-
|
1076
|
-
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
1080
|
-
|
1081
|
-
|
1082
|
-
|
1083
|
-
|
1084
|
-
|
1085
|
-
|
1086
|
-
|
1087
|
-
|
1088
|
-
|
1089
|
-
|
1090
|
-
|
1091
|
-
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
1095
|
-
|
1096
|
-
|
1097
|
-
|
1098
|
-
|
1099
|
-
|
994
|
+
expect(tokens).to contain_exactly(
|
995
|
+
have_attributes(
|
996
|
+
type: :DQPRE,
|
997
|
+
value: '',
|
998
|
+
line: 1,
|
999
|
+
column: 1,
|
1000
|
+
),
|
1001
|
+
have_attributes(
|
1002
|
+
type: :VARIABLE,
|
1003
|
+
value: 'foo',
|
1004
|
+
line: 1,
|
1005
|
+
column: 4,
|
1006
|
+
),
|
1007
|
+
have_attributes(
|
1008
|
+
type: :DOT,
|
1009
|
+
value: '.',
|
1010
|
+
line: 1,
|
1011
|
+
column: 8,
|
1012
|
+
),
|
1013
|
+
have_attributes(
|
1014
|
+
type: :NAME,
|
1015
|
+
value: 'map',
|
1016
|
+
line: 1,
|
1017
|
+
column: 9,
|
1018
|
+
),
|
1019
|
+
have_attributes(
|
1020
|
+
type: :WHITESPACE,
|
1021
|
+
value: ' ',
|
1022
|
+
line: 1,
|
1023
|
+
column: 12,
|
1024
|
+
),
|
1025
|
+
have_attributes(
|
1026
|
+
type: :PIPE,
|
1027
|
+
value: '|',
|
1028
|
+
line: 1,
|
1029
|
+
column: 13,
|
1030
|
+
),
|
1031
|
+
have_attributes(
|
1032
|
+
type: :VARIABLE,
|
1033
|
+
value: 'bar',
|
1034
|
+
line: 1,
|
1035
|
+
column: 14,
|
1036
|
+
),
|
1037
|
+
have_attributes(
|
1038
|
+
type: :PIPE,
|
1039
|
+
value: '|',
|
1040
|
+
line: 1,
|
1041
|
+
column: 18,
|
1042
|
+
),
|
1043
|
+
have_attributes(
|
1044
|
+
type: :WHITESPACE,
|
1045
|
+
value: ' ',
|
1046
|
+
line: 1,
|
1047
|
+
column: 19,
|
1048
|
+
),
|
1049
|
+
have_attributes(
|
1050
|
+
type: :LBRACE,
|
1051
|
+
value: '{',
|
1052
|
+
line: 1,
|
1053
|
+
column: 20,
|
1054
|
+
),
|
1055
|
+
have_attributes(
|
1056
|
+
type: :WHITESPACE,
|
1057
|
+
value: ' ',
|
1058
|
+
line: 1,
|
1059
|
+
column: 21,
|
1060
|
+
),
|
1061
|
+
have_attributes(
|
1062
|
+
type: :FUNCTION_NAME,
|
1063
|
+
value: 'something',
|
1064
|
+
line: 1,
|
1065
|
+
column: 22,
|
1066
|
+
),
|
1067
|
+
have_attributes(
|
1068
|
+
type: :LPAREN,
|
1069
|
+
value: '(',
|
1070
|
+
line: 1,
|
1071
|
+
column: 31,
|
1072
|
+
),
|
1073
|
+
have_attributes(
|
1074
|
+
type: :VARIABLE,
|
1075
|
+
value: 'bar',
|
1076
|
+
line: 1,
|
1077
|
+
column: 32,
|
1078
|
+
),
|
1079
|
+
have_attributes(
|
1080
|
+
type: :RPAREN,
|
1081
|
+
value: ')',
|
1082
|
+
line: 1,
|
1083
|
+
column: 36,
|
1084
|
+
),
|
1085
|
+
have_attributes(
|
1086
|
+
type: :WHITESPACE,
|
1087
|
+
value: ' ',
|
1088
|
+
line: 1,
|
1089
|
+
column: 37,
|
1090
|
+
),
|
1091
|
+
have_attributes(
|
1092
|
+
type: :RBRACE,
|
1093
|
+
value: '}',
|
1094
|
+
line: 1,
|
1095
|
+
column: 38,
|
1096
|
+
),
|
1097
|
+
have_attributes(
|
1098
|
+
type: :DQPOST,
|
1099
|
+
value: '',
|
1100
|
+
line: 1,
|
1101
|
+
column: 39,
|
1102
|
+
),
|
1100
1103
|
)
|
1101
1104
|
end
|
1102
1105
|
|