puppet-lint 2.3.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
@@ -5,7 +5,7 @@ describe 'slash_comments' do
|
|
5
5
|
|
6
6
|
context 'with fix disabled' do
|
7
7
|
context 'slash comments' do
|
8
|
-
let(:code) {
|
8
|
+
let(:code) { '// foo' }
|
9
9
|
|
10
10
|
it 'should only detect a single problem' do
|
11
11
|
expect(problems).to have(1).problem
|
@@ -38,7 +38,7 @@ describe 'slash_comments' do
|
|
38
38
|
end
|
39
39
|
|
40
40
|
it 'should replace the double slash with a hash' do
|
41
|
-
expect(manifest).to eq(
|
41
|
+
expect(manifest).to eq('# foo')
|
42
42
|
end
|
43
43
|
end
|
44
44
|
end
|
@@ -5,17 +5,19 @@ describe 'star_comments' do
|
|
5
5
|
|
6
6
|
context 'with fix disabled' do
|
7
7
|
context 'multiline comment w/ one line of content' do
|
8
|
-
let(:code)
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
let(:code) do
|
9
|
+
<<-END
|
10
|
+
/* foo
|
11
|
+
*/
|
12
|
+
END
|
13
|
+
end
|
12
14
|
|
13
15
|
it 'should only detect a single problem' do
|
14
16
|
expect(problems).to have(1).problem
|
15
17
|
end
|
16
18
|
|
17
19
|
it 'should create a warning' do
|
18
|
-
expect(problems).to contain_warning(msg).on_line(
|
20
|
+
expect(problems).to contain_warning(msg).on_line(1).in_column(11)
|
19
21
|
end
|
20
22
|
end
|
21
23
|
end
|
@@ -30,13 +32,21 @@ describe 'star_comments' do
|
|
30
32
|
end
|
31
33
|
|
32
34
|
context 'multiline comment w/ no indents' do
|
33
|
-
let(:code)
|
34
|
-
|
35
|
-
*
|
35
|
+
let(:code) do
|
36
|
+
<<-END.gsub(%r{^ {10}}, '')
|
37
|
+
/* foo *
|
38
|
+
* *
|
39
|
+
* bar */
|
40
|
+
END
|
41
|
+
end
|
36
42
|
|
37
|
-
let(:fixed)
|
38
|
-
|
39
|
-
#
|
43
|
+
let(:fixed) do
|
44
|
+
<<-END.gsub(%r{^ {10}}, '')
|
45
|
+
# foo *
|
46
|
+
# *
|
47
|
+
# bar
|
48
|
+
END
|
49
|
+
end
|
40
50
|
|
41
51
|
it 'should only detect a single problem' do
|
42
52
|
expect(problems).to have(1).problem
|
@@ -50,23 +60,27 @@ describe 'star_comments' do
|
|
50
60
|
expect(manifest).to eq(fixed)
|
51
61
|
end
|
52
62
|
end
|
53
|
-
|
63
|
+
|
54
64
|
context 'multiline comment w/ one line of content' do
|
55
|
-
let(:code)
|
56
|
-
|
57
|
-
|
58
|
-
|
65
|
+
let(:code) do
|
66
|
+
<<-END
|
67
|
+
/* foo
|
68
|
+
*/
|
69
|
+
END
|
70
|
+
end
|
59
71
|
|
60
|
-
let(:fixed)
|
61
|
-
|
62
|
-
|
72
|
+
let(:fixed) do
|
73
|
+
<<-END
|
74
|
+
# foo
|
75
|
+
END
|
76
|
+
end
|
63
77
|
|
64
78
|
it 'should only detect a single problem' do
|
65
79
|
expect(problems).to have(1).problem
|
66
80
|
end
|
67
81
|
|
68
82
|
it 'should create a warning' do
|
69
|
-
expect(problems).to contain_fixed(msg).on_line(
|
83
|
+
expect(problems).to contain_fixed(msg).on_line(1).in_column(11)
|
70
84
|
end
|
71
85
|
|
72
86
|
it 'should convert the multiline comment' do
|
@@ -75,27 +89,31 @@ describe 'star_comments' do
|
|
75
89
|
end
|
76
90
|
|
77
91
|
context 'multiline comment w/ multiple line of content' do
|
78
|
-
let(:code)
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
+
let(:code) do
|
93
|
+
<<-END
|
94
|
+
/* foo
|
95
|
+
* bar
|
96
|
+
* baz
|
97
|
+
*/
|
98
|
+
notify { 'foo': }
|
99
|
+
END
|
100
|
+
end
|
101
|
+
|
102
|
+
let(:fixed) do
|
103
|
+
<<-END
|
104
|
+
# foo
|
105
|
+
# bar
|
106
|
+
# baz
|
107
|
+
notify { 'foo': }
|
108
|
+
END
|
109
|
+
end
|
92
110
|
|
93
111
|
it 'should only detect a single problem' do
|
94
112
|
expect(problems).to have(1).problem
|
95
113
|
end
|
96
114
|
|
97
115
|
it 'should create a warning' do
|
98
|
-
expect(problems).to contain_fixed(msg).on_line(
|
116
|
+
expect(problems).to contain_fixed(msg).on_line(1).in_column(11)
|
99
117
|
end
|
100
118
|
|
101
119
|
it 'should convert the multiline comment' do
|
@@ -4,12 +4,14 @@ describe 'case_without_default' do
|
|
4
4
|
let(:msg) { 'case statement without a default case' }
|
5
5
|
|
6
6
|
context 'case statement with a default case' do
|
7
|
-
let(:code)
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
7
|
+
let(:code) do
|
8
|
+
<<-END
|
9
|
+
case $foo {
|
10
|
+
bar: { }
|
11
|
+
default: { }
|
12
|
+
}
|
13
|
+
END
|
14
|
+
end
|
13
15
|
|
14
16
|
it 'should not detect any problems' do
|
15
17
|
expect(problems).to have(0).problems
|
@@ -17,31 +19,35 @@ describe 'case_without_default' do
|
|
17
19
|
end
|
18
20
|
|
19
21
|
context 'case statement without a default case' do
|
20
|
-
let(:code)
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
let(:code) do
|
23
|
+
<<-END
|
24
|
+
case $foo {
|
25
|
+
bar: { }
|
26
|
+
baz: { }
|
27
|
+
}
|
28
|
+
END
|
29
|
+
end
|
26
30
|
|
27
31
|
it 'should only detect a single problem' do
|
28
32
|
expect(problems).to have(1).problem
|
29
33
|
end
|
30
34
|
|
31
35
|
it 'should create a warning' do
|
32
|
-
expect(problems).to contain_warning(msg).on_line(
|
36
|
+
expect(problems).to contain_warning(msg).on_line(1).in_column(9)
|
33
37
|
end
|
34
38
|
end
|
35
|
-
|
39
|
+
|
36
40
|
context 'nested case statements without a default case on the outermost' do
|
37
|
-
let(:code)
|
38
|
-
|
39
|
-
case $
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
41
|
+
let(:code) do
|
42
|
+
<<-END
|
43
|
+
case $foo {
|
44
|
+
case $foop {
|
45
|
+
bar: {}
|
46
|
+
default: {}
|
47
|
+
}
|
48
|
+
}
|
49
|
+
END
|
50
|
+
end
|
45
51
|
|
46
52
|
it 'should only detect a single problem' do
|
47
53
|
expect(problems).to have(1).problem
|
@@ -53,43 +59,47 @@ describe 'case_without_default' do
|
|
53
59
|
end
|
54
60
|
|
55
61
|
context 'three nested case statements with two missing default cases' do
|
56
|
-
let(:code)
|
57
|
-
|
58
|
-
case $
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
62
|
+
let(:code) do
|
63
|
+
<<-END
|
64
|
+
case $foo {
|
65
|
+
case $foop {
|
66
|
+
bar: {}
|
67
|
+
case $woop {
|
68
|
+
baz: {}
|
69
|
+
}
|
70
|
+
default: {}
|
71
|
+
}
|
72
|
+
}
|
73
|
+
END
|
74
|
+
end
|
67
75
|
|
68
76
|
it 'should detect two problems' do
|
69
77
|
expect(problems).to have(2).problems
|
70
78
|
end
|
71
79
|
|
72
80
|
it 'should create two warnings' do
|
73
|
-
expect(problems).to contain_warning(msg).on_line(
|
74
|
-
expect(problems).to contain_warning(msg).on_line(
|
81
|
+
expect(problems).to contain_warning(msg).on_line(1).in_column(9)
|
82
|
+
expect(problems).to contain_warning(msg).on_line(4).in_column(13)
|
75
83
|
end
|
76
84
|
end
|
77
85
|
|
78
86
|
context 'issue-117' do
|
79
|
-
let(:code)
|
80
|
-
|
81
|
-
mem
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
87
|
+
let(:code) do
|
88
|
+
<<-END
|
89
|
+
$mem = inline_template('<%
|
90
|
+
mem,unit = scope.lookupvar(\'::memorysize\').split
|
91
|
+
mem = mem.to_f
|
92
|
+
# Normalize mem to bytes
|
93
|
+
case unit
|
94
|
+
when nil: mem *= (1<<0)
|
95
|
+
when \'kB\': mem *= (1<<10)
|
96
|
+
when \'MB\': mem *= (1<<20)
|
97
|
+
when \'GB\': mem *= (1<<30)
|
98
|
+
when \'TB\': mem *= (1<<40)
|
99
|
+
end
|
100
|
+
%><%= mem.to_i %>')
|
101
|
+
END
|
102
|
+
end
|
93
103
|
|
94
104
|
it 'should not detect any problems' do
|
95
105
|
expect(problems).to have(0).problems
|
@@ -4,30 +4,34 @@ describe 'selector_inside_resource' do
|
|
4
4
|
let(:msg) { 'selector inside resource block' }
|
5
5
|
|
6
6
|
context 'resource with a selector' do
|
7
|
-
let(:code)
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
7
|
+
let(:code) do
|
8
|
+
<<-END
|
9
|
+
file { 'foo':
|
10
|
+
ensure => $bar ? {
|
11
|
+
true => present,
|
12
|
+
default => absent,
|
13
|
+
},
|
14
|
+
}
|
15
|
+
END
|
16
|
+
end
|
15
17
|
|
16
18
|
it 'should only detect a single problem' do
|
17
19
|
expect(problems).to have(1).problem
|
18
20
|
end
|
19
21
|
|
20
22
|
it 'should create a warning' do
|
21
|
-
expect(problems).to contain_warning(msg).on_line(
|
23
|
+
expect(problems).to contain_warning(msg).on_line(2).in_column(18)
|
22
24
|
end
|
23
25
|
end
|
24
26
|
|
25
27
|
context 'resource with a variable as a attr value' do
|
26
|
-
let(:code)
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
28
|
+
let(:code) do
|
29
|
+
<<-END
|
30
|
+
file { 'foo',
|
31
|
+
ensure => $bar,
|
32
|
+
}
|
33
|
+
END
|
34
|
+
end
|
31
35
|
|
32
36
|
it 'should not detect any problems' do
|
33
37
|
expect(problems).to have(0).problems
|
@@ -5,7 +5,7 @@ describe 'documentation' do
|
|
5
5
|
let(:define_msg) { 'defined type not documented' }
|
6
6
|
|
7
7
|
describe 'undocumented class' do
|
8
|
-
let(:code) {
|
8
|
+
let(:code) { 'class test {}' }
|
9
9
|
|
10
10
|
it 'should only detect a single problem' do
|
11
11
|
expect(problems).to have(1).problem
|
@@ -17,10 +17,12 @@ describe 'documentation' do
|
|
17
17
|
end
|
18
18
|
|
19
19
|
describe 'documented class' do
|
20
|
-
let(:code)
|
21
|
-
|
22
|
-
|
23
|
-
|
20
|
+
let(:code) do
|
21
|
+
<<-END
|
22
|
+
# foo
|
23
|
+
class test {}
|
24
|
+
END
|
25
|
+
end
|
24
26
|
|
25
27
|
it 'should not detect any problems' do
|
26
28
|
expect(problems).to have(0).problems
|
@@ -28,7 +30,7 @@ describe 'documentation' do
|
|
28
30
|
end
|
29
31
|
|
30
32
|
describe 'undocumented defined type' do
|
31
|
-
let(:code) {
|
33
|
+
let(:code) { 'define test {}' }
|
32
34
|
|
33
35
|
it 'should only detect a single problem' do
|
34
36
|
expect(problems).to have(1).problem
|
@@ -40,10 +42,12 @@ describe 'documentation' do
|
|
40
42
|
end
|
41
43
|
|
42
44
|
describe 'documented defined type' do
|
43
|
-
let(:code)
|
44
|
-
|
45
|
-
|
46
|
-
|
45
|
+
let(:code) do
|
46
|
+
<<-END
|
47
|
+
# foo
|
48
|
+
define test {}
|
49
|
+
END
|
50
|
+
end
|
47
51
|
|
48
52
|
it 'should not detect any problems' do
|
49
53
|
expect(problems).to have(0).problems
|
@@ -5,7 +5,7 @@ describe 'unquoted_node_name' do
|
|
5
5
|
|
6
6
|
context 'with fix disabled' do
|
7
7
|
context 'unquoted node name' do
|
8
|
-
let(:code) {
|
8
|
+
let(:code) { 'node foo { }' }
|
9
9
|
|
10
10
|
it 'should only detect a single problem' do
|
11
11
|
expect(problems).to have(1).problem
|
@@ -17,7 +17,7 @@ describe 'unquoted_node_name' do
|
|
17
17
|
end
|
18
18
|
|
19
19
|
context 'default node' do
|
20
|
-
let(:code) {
|
20
|
+
let(:code) { 'node default { }' }
|
21
21
|
|
22
22
|
it 'should not detect any problems' do
|
23
23
|
expect(problems).to have(0).problems
|
@@ -33,7 +33,7 @@ describe 'unquoted_node_name' do
|
|
33
33
|
end
|
34
34
|
|
35
35
|
context 'regex node name' do
|
36
|
-
let(:code) {
|
36
|
+
let(:code) { 'node /foo/ { }' }
|
37
37
|
|
38
38
|
it 'should not detect any problems' do
|
39
39
|
expect(problems).to have(0).problems
|
@@ -41,7 +41,7 @@ describe 'unquoted_node_name' do
|
|
41
41
|
end
|
42
42
|
|
43
43
|
context 'multiple bare node names' do
|
44
|
-
let(:code) {
|
44
|
+
let(:code) { 'node foo, bar, baz { }' }
|
45
45
|
|
46
46
|
it 'should detect 3 problems' do
|
47
47
|
expect(problems).to have(3).problems
|
@@ -68,7 +68,7 @@ describe 'unquoted_node_name' do
|
|
68
68
|
end
|
69
69
|
|
70
70
|
context 'multiple node blocks' do
|
71
|
-
let(:code) {
|
71
|
+
let(:code) { 'node foo { } node bar { }' }
|
72
72
|
|
73
73
|
it 'should detect 2 problems' do
|
74
74
|
expect(problems).to have(2).problems
|
@@ -103,7 +103,7 @@ describe 'unquoted_node_name' do
|
|
103
103
|
end
|
104
104
|
|
105
105
|
context 'unquoted node name' do
|
106
|
-
let(:code) {
|
106
|
+
let(:code) { 'node foo { }' }
|
107
107
|
|
108
108
|
it 'should only detect a single problem' do
|
109
109
|
expect(problems).to have(1).problem
|
@@ -119,7 +119,7 @@ describe 'unquoted_node_name' do
|
|
119
119
|
end
|
120
120
|
|
121
121
|
context 'multiple bare node names' do
|
122
|
-
let(:code) {
|
122
|
+
let(:code) { 'node foo, bar, baz { }' }
|
123
123
|
let(:fixed) { "node 'foo', 'bar', 'baz' { }" }
|
124
124
|
|
125
125
|
it 'should detect 3 problems' do
|