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
@@ -14,7 +14,7 @@ describe 'case_without_default' do
14
14
  end
15
15
 
16
16
  it 'does not detect any problems' do
17
- expect(problems).to have(0).problems
17
+ expect(problems).to be_empty
18
18
  end
19
19
  end
20
20
 
@@ -29,7 +29,7 @@ describe 'case_without_default' do
29
29
  end
30
30
 
31
31
  it 'only detects a single problem' do
32
- expect(problems).to have(1).problem
32
+ expect(problems.size).to eq(1)
33
33
  end
34
34
 
35
35
  it 'creates a warning' do
@@ -50,7 +50,7 @@ describe 'case_without_default' do
50
50
  end
51
51
 
52
52
  it 'only detects a single problem' do
53
- expect(problems).to have(1).problem
53
+ expect(problems.size).to eq(1)
54
54
  end
55
55
 
56
56
  it 'creates a warning' do
@@ -74,7 +74,7 @@ describe 'case_without_default' do
74
74
  end
75
75
 
76
76
  it 'detects two problems' do
77
- expect(problems).to have(2).problems
77
+ expect(problems.size).to eq(2)
78
78
  end
79
79
 
80
80
  it 'creates two warnings' do
@@ -102,7 +102,7 @@ describe 'case_without_default' do
102
102
  end
103
103
 
104
104
  it 'does not detect any problems' do
105
- expect(problems).to have(0).problems
105
+ expect(problems).to be_empty
106
106
  end
107
107
  end
108
108
 
@@ -141,7 +141,7 @@ describe 'case_without_default' do
141
141
  end
142
142
 
143
143
  it 'does not detect any problems' do
144
- expect(problems).to have(0).problems
144
+ expect(problems).to be_empty
145
145
  end
146
146
  end
147
147
  end
@@ -16,7 +16,7 @@ describe 'selector_inside_resource' do
16
16
  end
17
17
 
18
18
  it 'only detects a single problem' do
19
- expect(problems).to have(1).problem
19
+ expect(problems.size).to eq(1)
20
20
  end
21
21
 
22
22
  it 'creates a warning' do
@@ -34,7 +34,7 @@ describe 'selector_inside_resource' do
34
34
  end
35
35
 
36
36
  it 'does not detect any problems' do
37
- expect(problems).to have(0).problems
37
+ expect(problems).to be_empty
38
38
  end
39
39
  end
40
40
  end
@@ -8,7 +8,7 @@ describe 'documentation' do
8
8
  let(:code) { 'class test {}' }
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 a warning' do
@@ -25,7 +25,7 @@ describe 'documentation' do
25
25
  end
26
26
 
27
27
  it 'does not detect any problems' do
28
- expect(problems).to have(0).problems
28
+ expect(problems).to be_empty
29
29
  end
30
30
  end
31
31
 
@@ -39,7 +39,7 @@ describe 'documentation' do
39
39
  end
40
40
 
41
41
  it 'only detects a single problem' do
42
- expect(problems).to have(1).problem
42
+ expect(problems.size).to eq(1)
43
43
  end
44
44
 
45
45
  it 'creates a warning' do
@@ -51,7 +51,7 @@ describe 'documentation' do
51
51
  let(:code) { 'define test {}' }
52
52
 
53
53
  it 'only detects a single problem' do
54
- expect(problems).to have(1).problem
54
+ expect(problems.size).to eq(1)
55
55
  end
56
56
 
57
57
  it 'creates a warning' do
@@ -68,7 +68,7 @@ describe 'documentation' do
68
68
  end
69
69
 
70
70
  it 'does not detect any problems' do
71
- expect(problems).to have(0).problems
71
+ expect(problems).to be_empty
72
72
  end
73
73
  end
74
74
  end
@@ -8,7 +8,7 @@ describe 'unquoted_node_name' do
8
8
  let(:code) { 'node 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 a warning' do
@@ -20,7 +20,7 @@ describe 'unquoted_node_name' do
20
20
  let(:code) { 'node default { }' }
21
21
 
22
22
  it 'does not detect any problems' do
23
- expect(problems).to have(0).problems
23
+ expect(problems).to be_empty
24
24
  end
25
25
  end
26
26
 
@@ -28,7 +28,7 @@ describe 'unquoted_node_name' do
28
28
  let(:code) { "node 'foo' { }" }
29
29
 
30
30
  it 'does not detect any problems' do
31
- expect(problems).to have(0).problems
31
+ expect(problems).to be_empty
32
32
  end
33
33
  end
34
34
 
@@ -36,7 +36,7 @@ describe 'unquoted_node_name' do
36
36
  let(:code) { 'node /foo/ { }' }
37
37
 
38
38
  it 'does not detect any problems' do
39
- expect(problems).to have(0).problems
39
+ expect(problems).to be_empty
40
40
  end
41
41
  end
42
42
 
@@ -44,7 +44,7 @@ describe 'unquoted_node_name' do
44
44
  let(:code) { 'node foo, bar, baz { }' }
45
45
 
46
46
  it 'detects 3 problems' do
47
- expect(problems).to have(3).problems
47
+ expect(problems.size).to eq(3)
48
48
  end
49
49
 
50
50
  it 'creates 3 warnings' do
@@ -58,7 +58,7 @@ describe 'unquoted_node_name' do
58
58
  let(:code) { "node foo, 'bar', baz { }" }
59
59
 
60
60
  it 'detects 2 problems' do
61
- expect(problems).to have(2).problems
61
+ expect(problems.size).to eq(2)
62
62
  end
63
63
 
64
64
  it 'creates 2 warnings' do
@@ -71,7 +71,7 @@ describe 'unquoted_node_name' do
71
71
  let(:code) { 'node foo { } node bar { }' }
72
72
 
73
73
  it 'detects 2 problems' do
74
- expect(problems).to have(2).problems
74
+ expect(problems.size).to eq(2)
75
75
  end
76
76
 
77
77
  it 'creates 2 warnings' do
@@ -84,7 +84,7 @@ describe 'unquoted_node_name' do
84
84
  let(:code) { 'node foo' }
85
85
 
86
86
  it 'detects a problem' do
87
- expect(problems).to have(1).problem
87
+ expect(problems.size).to eq(1)
88
88
  end
89
89
 
90
90
  it 'creates 1 error' do
@@ -106,7 +106,7 @@ describe 'unquoted_node_name' do
106
106
  let(:code) { 'node foo { }' }
107
107
 
108
108
  it 'only detects a single problem' do
109
- expect(problems).to have(1).problem
109
+ expect(problems.size).to eq(1)
110
110
  end
111
111
 
112
112
  it 'fixes the manifest' do
@@ -123,7 +123,7 @@ describe 'unquoted_node_name' do
123
123
  let(:fixed) { "node 'foo', 'bar', 'baz' { }" }
124
124
 
125
125
  it 'detects 3 problems' do
126
- expect(problems).to have(3).problems
126
+ expect(problems.size).to eq(3)
127
127
  end
128
128
 
129
129
  it 'fixes the 3 problems' do
@@ -142,7 +142,7 @@ describe 'unquoted_node_name' do
142
142
  let(:fixed) { "node 'foo', 'bar', 'baz' { }" }
143
143
 
144
144
  it 'detects 2 problems' do
145
- expect(problems).to have(2).problems
145
+ expect(problems.size).to eq(2)
146
146
  end
147
147
 
148
148
  it 'fixes the 2 problems' do
@@ -16,7 +16,7 @@ describe 'duplicate_params' do
16
16
  end
17
17
 
18
18
  it 'only detects a single problem' do
19
- expect(problems).to have(1).problem
19
+ expect(problems.size).to eq(1)
20
20
  end
21
21
 
22
22
  it 'creates an error' do
@@ -37,7 +37,7 @@ describe 'duplicate_params' do
37
37
  end
38
38
 
39
39
  it 'does not detect any errors' do
40
- expect(problems).to have(0).problems
40
+ expect(problems).to be_empty
41
41
  end
42
42
  end
43
43
 
@@ -54,7 +54,7 @@ describe 'duplicate_params' do
54
54
  end
55
55
 
56
56
  it 'only detects a single error' do
57
- expect(problems).to have(1).problem
57
+ expect(problems.size).to eq(1)
58
58
  end
59
59
 
60
60
  it 'creates an error' do
@@ -77,7 +77,7 @@ describe 'duplicate_params' do
77
77
  end
78
78
 
79
79
  it 'only detects a single problem' do
80
- expect(problems).to have(1).problem
80
+ expect(problems.size).to eq(1)
81
81
  end
82
82
 
83
83
  it 'creates an error' do
@@ -96,7 +96,7 @@ describe 'duplicate_params' do
96
96
  end
97
97
 
98
98
  it 'does not detect any problems' do
99
- expect(problems).to have(0).problems
99
+ expect(problems).to be_empty
100
100
  end
101
101
  end
102
102
 
@@ -104,7 +104,7 @@ describe 'duplicate_params' do
104
104
  let(:code) { '}:' }
105
105
 
106
106
  it 'does not detect any problems' do
107
- expect(problems).to have(0).problems
107
+ expect(problems).to be_empty
108
108
  end
109
109
  end
110
110
  end
@@ -8,7 +8,7 @@ describe 'ensure_first_param' do
8
8
  let(:code) { "file { 'foo': ensure => present }" }
9
9
 
10
10
  it 'does not detect any problems' do
11
- expect(problems).to have(0).problems
11
+ expect(problems).to be_empty
12
12
  end
13
13
  end
14
14
 
@@ -22,7 +22,7 @@ describe 'ensure_first_param' do
22
22
  end
23
23
 
24
24
  it 'does not detect any problems' do
25
- expect(problems).to have(0).problems
25
+ expect(problems).to be_empty
26
26
  end
27
27
  end
28
28
 
@@ -37,7 +37,7 @@ describe 'ensure_first_param' do
37
37
  end
38
38
 
39
39
  it 'only detects a single problem' do
40
- expect(problems).to have(1).problem
40
+ expect(problems.size).to eq(1)
41
41
  end
42
42
 
43
43
  it 'creates a warning' do
@@ -56,7 +56,7 @@ describe 'ensure_first_param' do
56
56
  end
57
57
 
58
58
  it 'does not detect any problems' do
59
- expect(problems).to have(0).problems
59
+ expect(problems).to be_empty
60
60
  end
61
61
  end
62
62
 
@@ -77,7 +77,7 @@ describe 'ensure_first_param' do
77
77
  end
78
78
 
79
79
  it 'does not detect any problems' do
80
- expect(problems).to have(0).problems
80
+ expect(problems).to be_empty
81
81
  end
82
82
  end
83
83
 
@@ -93,7 +93,7 @@ describe 'ensure_first_param' do
93
93
  end
94
94
 
95
95
  it 'does not detect any problems' do
96
- expect(problems).to have(0).problems
96
+ expect(problems).to be_empty
97
97
  end
98
98
  end
99
99
  end
@@ -111,7 +111,7 @@ describe 'ensure_first_param' do
111
111
  let(:code) { "file { 'foo': ensure => present }" }
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
 
@@ -125,7 +125,7 @@ describe 'ensure_first_param' do
125
125
  end
126
126
 
127
127
  it 'does not detect any problems' do
128
- expect(problems).to have(0).problems
128
+ expect(problems).to be_empty
129
129
  end
130
130
  end
131
131
 
@@ -149,7 +149,7 @@ describe 'ensure_first_param' do
149
149
  end
150
150
 
151
151
  it 'only detects a single problem' do
152
- expect(problems).to have(1).problem
152
+ expect(problems.size).to eq(1)
153
153
  end
154
154
 
155
155
  it 'creates a warning' do
@@ -172,7 +172,7 @@ describe 'ensure_first_param' do
172
172
  end
173
173
 
174
174
  it 'does not detect any problems' do
175
- expect(problems).to have(0).problems
175
+ expect(problems).to be_empty
176
176
  end
177
177
  end
178
178
 
@@ -193,7 +193,7 @@ describe 'ensure_first_param' do
193
193
  end
194
194
 
195
195
  it 'does not detect any problems' do
196
- expect(problems).to have(0).problems
196
+ expect(problems).to be_empty
197
197
  end
198
198
  end
199
199
 
@@ -229,7 +229,7 @@ describe 'ensure_first_param' do
229
229
  end
230
230
 
231
231
  it 'detects a problem' do
232
- expect(problems).to have(1).problem
232
+ expect(problems.size).to eq(1)
233
233
  end
234
234
 
235
235
  it 'fixes the problem' do
@@ -15,7 +15,7 @@ describe 'ensure_not_symlink_target' do
15
15
  end
16
16
 
17
17
  it 'does not detect any problems' do
18
- expect(problems).to have(0).problems
18
+ expect(problems).to be_empty
19
19
  end
20
20
  end
21
21
 
@@ -29,7 +29,7 @@ describe 'ensure_not_symlink_target' do
29
29
  end
30
30
 
31
31
  it 'only detects a single problem' do
32
- expect(problems).to have(1).problem
32
+ expect(problems.size).to eq(1)
33
33
  end
34
34
 
35
35
  it 'creates a warning' do
@@ -58,7 +58,7 @@ describe 'ensure_not_symlink_target' do
58
58
  end
59
59
 
60
60
  it 'does not detect any problems' do
61
- expect(problems).to have(0).problems
61
+ expect(problems).to be_empty
62
62
  end
63
63
 
64
64
  it 'does not modify the manifest' do
@@ -85,7 +85,7 @@ describe 'ensure_not_symlink_target' do
85
85
  end
86
86
 
87
87
  it 'only detects a single problem' do
88
- expect(problems).to have(1).problem
88
+ expect(problems.size).to eq(1)
89
89
  end
90
90
 
91
91
  it 'fixes the problem' do
@@ -8,7 +8,7 @@ describe 'file_mode' do
8
8
  let(:code) { "file { 'foo': mode => '777' }" }
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 a warning' do
@@ -20,7 +20,7 @@ describe 'file_mode' do
20
20
  let(:code) { "file { 'foo': mode => '0777' }" }
21
21
 
22
22
  it 'does not detect any problems' do
23
- expect(problems).to have(0).problems
23
+ expect(problems).to be_empty
24
24
  end
25
25
  end
26
26
 
@@ -28,7 +28,7 @@ describe 'file_mode' do
28
28
  let(:code) { "file { 'foo': mode => $file_mode }" }
29
29
 
30
30
  it 'does not detect any problems' do
31
- expect(problems).to have(0).problems
31
+ expect(problems).to be_empty
32
32
  end
33
33
  end
34
34
 
@@ -36,7 +36,7 @@ describe 'file_mode' do
36
36
  let(:code) { "file { 'foo': mode => 'u=rw,og=r' }" }
37
37
 
38
38
  it 'does not detect any problems' do
39
- expect(problems).to have(0).problems
39
+ expect(problems).to be_empty
40
40
  end
41
41
  end
42
42
 
@@ -44,7 +44,7 @@ describe 'file_mode' do
44
44
  let(:code) { "file { 'foo': mode => undef }" }
45
45
 
46
46
  it 'does not detect any problems' do
47
- expect(problems).to have(0).problems
47
+ expect(problems).to be_empty
48
48
  end
49
49
  end
50
50
 
@@ -52,7 +52,7 @@ describe 'file_mode' do
52
52
  let(:code) { "file { 'foo': mode => 'undef' }" }
53
53
 
54
54
  it 'only detects a single problem' do
55
- expect(problems).to have(1).problem
55
+ expect(problems.size).to eq(1)
56
56
  end
57
57
 
58
58
  it 'creates a warning' do
@@ -64,7 +64,7 @@ describe 'file_mode' do
64
64
  let(:code) { "file { '/etc/passwd': audit => [ owner, mode ], }" }
65
65
 
66
66
  it 'does not detect any problems' do
67
- expect(problems).to have(0).problems
67
+ expect(problems).to be_empty
68
68
  end
69
69
  end
70
70
 
@@ -72,7 +72,7 @@ describe 'file_mode' do
72
72
  let(:code) { "concat { 'foo': mode => '777' }" }
73
73
 
74
74
  it 'only detects a single problem' do
75
- expect(problems).to have(1).problem
75
+ expect(problems.size).to eq(1)
76
76
  end
77
77
 
78
78
  it 'creates a warning' do
@@ -84,7 +84,7 @@ describe 'file_mode' do
84
84
  let(:code) { "concat { 'foo': mode => '0777' }" }
85
85
 
86
86
  it 'does not detect any problems' do
87
- expect(problems).to have(0).problems
87
+ expect(problems).to be_empty
88
88
  end
89
89
  end
90
90
 
@@ -92,7 +92,7 @@ describe 'file_mode' do
92
92
  let(:code) { "concat { 'foo': mode => $concat_mode }" }
93
93
 
94
94
  it 'does not detect any problems' do
95
- expect(problems).to have(0).problems
95
+ expect(problems).to be_empty
96
96
  end
97
97
  end
98
98
 
@@ -100,7 +100,7 @@ describe 'file_mode' do
100
100
  let(:code) { "concat { 'foo': mode => 'u=rw,og=r' }" }
101
101
 
102
102
  it 'does not detect any problems' do
103
- expect(problems).to have(0).problems
103
+ expect(problems).to be_empty
104
104
  end
105
105
  end
106
106
 
@@ -108,7 +108,7 @@ describe 'file_mode' do
108
108
  let(:code) { "concat { 'foo': mode => undef }" }
109
109
 
110
110
  it 'does not detect any problems' do
111
- expect(problems).to have(0).problems
111
+ expect(problems).to be_empty
112
112
  end
113
113
  end
114
114
 
@@ -116,7 +116,7 @@ describe 'file_mode' do
116
116
  let(:code) { "concat { 'foo': mode => 'undef' }" }
117
117
 
118
118
  it 'only detects a single problem' do
119
- expect(problems).to have(1).problem
119
+ expect(problems.size).to eq(1)
120
120
  end
121
121
 
122
122
  it 'creates a warning' do
@@ -128,7 +128,7 @@ describe 'file_mode' do
128
128
  let(:code) { "concat { '/etc/passwd': audit => [ owner, mode ], }" }
129
129
 
130
130
  it 'does not detect any problems' do
131
- expect(problems).to have(0).problems
131
+ expect(problems).to be_empty
132
132
  end
133
133
  end
134
134
 
@@ -136,7 +136,7 @@ describe 'file_mode' do
136
136
  let(:code) { "file { 'foo': mode => lookup('bar'), }" }
137
137
 
138
138
  it 'does not detect any problems' do
139
- expect(problems).to have(0).problems
139
+ expect(problems).to be_empty
140
140
  end
141
141
  end
142
142
 
@@ -156,7 +156,7 @@ describe 'file_mode' do
156
156
  end
157
157
 
158
158
  it 'detects 3 problems' do
159
- expect(problems).to have(3).problems
159
+ expect(problems.size).to eq(3)
160
160
  end
161
161
 
162
162
  it 'creates three warnings' do
@@ -180,7 +180,7 @@ describe 'file_mode' do
180
180
  let(:code) { "file { 'foo': mode => '777' }" }
181
181
 
182
182
  it 'only detects a single problem' do
183
- expect(problems).to have(1).problem
183
+ expect(problems.size).to eq(1)
184
184
  end
185
185
 
186
186
  it 'fixes the manifest' do
@@ -196,7 +196,7 @@ describe 'file_mode' do
196
196
  let(:code) { "file { 'foo': mode => 'undef' }" }
197
197
 
198
198
  it 'only detects a single problem' do
199
- expect(problems).to have(1).problem
199
+ expect(problems.size).to eq(1)
200
200
  end
201
201
 
202
202
  it 'creates a warning' do
@@ -212,7 +212,7 @@ describe 'file_mode' do
212
212
  let(:code) { "concat { 'foo': mode => '777' }" }
213
213
 
214
214
  it 'only detects a single problem' do
215
- expect(problems).to have(1).problem
215
+ expect(problems.size).to eq(1)
216
216
  end
217
217
 
218
218
  it 'fixes the manifest' do
@@ -228,7 +228,7 @@ describe 'file_mode' do
228
228
  let(:code) { "concat { 'foo': mode => 'undef' }" }
229
229
 
230
230
  it 'only detects a single problem' do
231
- expect(problems).to have(1).problem
231
+ expect(problems.size).to eq(1)
232
232
  end
233
233
 
234
234
  it 'creates a warning' do
@@ -244,7 +244,7 @@ describe 'file_mode' do
244
244
  let(:code) { "file { 'foo': mode => lookup('bar'), }" }
245
245
 
246
246
  it 'does not detect any problems' do
247
- expect(problems).to have(0).problems
247
+ expect(problems).to be_empty
248
248
  end
249
249
 
250
250
  it 'does not change the manifest' do
@@ -282,7 +282,7 @@ describe 'file_mode' do
282
282
  end
283
283
 
284
284
  it 'detects 3 problems' do
285
- expect(problems).to have(3).problems
285
+ expect(problems.size).to eq(3)
286
286
  end
287
287
 
288
288
  it 'fixes 3 problems' do
@@ -8,7 +8,7 @@ describe 'unquoted_file_mode' do
8
8
  let(:code) { "file { 'foo': mode => 0777 }" }
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 a warning' do
@@ -20,7 +20,7 @@ describe 'unquoted_file_mode' do
20
20
  let(:code) { "concat { 'foo': mode => 0777 }" }
21
21
 
22
22
  it 'only detects a single problem' do
23
- expect(problems).to have(1).problem
23
+ expect(problems.size).to eq(1)
24
24
  end
25
25
 
26
26
  it 'creates a warning' do
@@ -32,7 +32,7 @@ describe 'unquoted_file_mode' do
32
32
  let(:code) { "file { 'foo': mode => lookup('bar'), }" }
33
33
 
34
34
  it 'does not detect any problems' do
35
- expect(problems).to have(0).problems
35
+ expect(problems).to be_empty
36
36
  end
37
37
  end
38
38
 
@@ -52,7 +52,7 @@ describe 'unquoted_file_mode' do
52
52
  end
53
53
 
54
54
  it 'detects 3 problems' do
55
- expect(problems).to have(3).problems
55
+ expect(problems.size).to eq(3)
56
56
  end
57
57
 
58
58
  it 'creates three warnings' do
@@ -76,7 +76,7 @@ describe 'unquoted_file_mode' do
76
76
  let(:code) { "file { 'foo': mode => 0777 }" }
77
77
 
78
78
  it 'only detects a single problem' do
79
- expect(problems).to have(1).problem
79
+ expect(problems.size).to eq(1)
80
80
  end
81
81
 
82
82
  it 'fixes the manifest' do
@@ -92,7 +92,7 @@ describe 'unquoted_file_mode' do
92
92
  let(:code) { "concat { 'foo': mode => 0777 }" }
93
93
 
94
94
  it 'only detects a single problem' do
95
- expect(problems).to have(1).problem
95
+ expect(problems.size).to eq(1)
96
96
  end
97
97
 
98
98
  it 'fixes the manifest' do
@@ -108,7 +108,7 @@ describe 'unquoted_file_mode' do
108
108
  let(:code) { "file { 'foo': mode => lookup('bar'), }" }
109
109
 
110
110
  it 'does not detect any problems' do
111
- expect(problems).to have(0).problems
111
+ expect(problems).to be_empty
112
112
  end
113
113
 
114
114
  it 'does not change the manifest' do
@@ -146,7 +146,7 @@ describe 'unquoted_file_mode' do
146
146
  end
147
147
 
148
148
  it 'detects 3 problems' do
149
- expect(problems).to have(3).problems
149
+ expect(problems.size).to eq(3)
150
150
  end
151
151
 
152
152
  it 'fixes 3 problems' do