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
@@ -41,7 +41,7 @@ describe 'double_quoted_strings' do
|
|
41
41
|
end
|
42
42
|
|
43
43
|
context 'double quoted string containing newline but no variables' do
|
44
|
-
let(:code) { %
|
44
|
+
let(:code) { %("foo\n") }
|
45
45
|
|
46
46
|
it 'should not detect any problems' do
|
47
47
|
expect(problems).to have(0).problems
|
@@ -49,18 +49,20 @@ describe 'double_quoted_strings' do
|
|
49
49
|
end
|
50
50
|
|
51
51
|
context 'double quoted string with backslash for continuation' do
|
52
|
-
let(:code)
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
52
|
+
let(:code) do
|
53
|
+
<<-END
|
54
|
+
class puppet::master::maintenance (
|
55
|
+
) {
|
56
|
+
cron { 'puppet_master_reports_cleanup':
|
57
|
+
command => "/usr/bin/find /var/lib/puppet/reports -type f -mtime +15 \
|
58
|
+
-delete && /usr/bin/find /var/lib/puppet/reports -mindepth 1 \
|
59
|
+
-empty -type d -delete",
|
60
|
+
minute => '15',
|
61
|
+
hour => '5',
|
62
|
+
}
|
61
63
|
}
|
62
|
-
|
63
|
-
|
64
|
+
END
|
65
|
+
end
|
64
66
|
|
65
67
|
it 'should not detect any problems' do
|
66
68
|
expect(problems).to have(0).problems
|
@@ -92,15 +94,17 @@ describe 'double_quoted_strings' do
|
|
92
94
|
end
|
93
95
|
|
94
96
|
context 'double quoted stings containing supported escape patterns' do
|
95
|
-
let(:code)
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
97
|
+
let(:code) do
|
98
|
+
<<-END
|
99
|
+
$string1 = "this string contins \n newline"
|
100
|
+
$string2 = "this string contains \ttab"
|
101
|
+
$string3 = "this string contains \${escaped} var"
|
102
|
+
$string4 = "this string contains \\"escaped \\" double quotes"
|
103
|
+
$string5 = "this string contains \\'escaped \\' single quotes"
|
104
|
+
$string6 = "this string contains \r line return"
|
105
|
+
$string7 = "this string contains \\\\ an escaped backslash"
|
106
|
+
END
|
107
|
+
end
|
104
108
|
|
105
109
|
it 'should not detect any problems' do
|
106
110
|
expect(problems).to have(0).problems
|
@@ -108,7 +112,7 @@ describe 'double_quoted_strings' do
|
|
108
112
|
end
|
109
113
|
|
110
114
|
context 'double quoted string with random escape should be rejected' do
|
111
|
-
let(:code) {%
|
115
|
+
let(:code) { %( $ztring = "this string contains \l random esape" ) }
|
112
116
|
|
113
117
|
it 'should only detect a single problem' do
|
114
118
|
expect(problems).to have(1).problem
|
@@ -128,7 +132,7 @@ describe 'double_quoted_strings' do
|
|
128
132
|
end
|
129
133
|
|
130
134
|
context 'double quoted string containing single quoted string' do
|
131
|
-
let(:code) { %
|
135
|
+
let(:code) { %(notify { "'foo'": }) }
|
132
136
|
|
133
137
|
it 'should not detect any problems' do
|
134
138
|
expect(problems).to have(0).problems
|
@@ -158,7 +162,7 @@ describe 'double_quoted_strings' do
|
|
158
162
|
end
|
159
163
|
|
160
164
|
context 'double quoted string containing a lone dollar' do
|
161
|
-
let(:code) {"\"sed -i 's/^;*[[:space:]]*${name}[[:space:]]*=.*$/${name} = ${value}/g' file\"" }
|
165
|
+
let(:code) { "\"sed -i 's/^;*[[:space:]]*${name}[[:space:]]*=.*$/${name} = ${value}/g' file\"" }
|
162
166
|
|
163
167
|
it 'should not detect any problems' do
|
164
168
|
expect(problems).to have(0).problems
|
@@ -41,12 +41,14 @@ describe 'only_variable_string' do
|
|
41
41
|
end
|
42
42
|
|
43
43
|
context 'string containing only a variable as a hash key' do
|
44
|
-
let(:code)
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
44
|
+
let(:code) do
|
45
|
+
<<-END
|
46
|
+
$bar = 'key'
|
47
|
+
$foo = {
|
48
|
+
\"$bar\" => 1,
|
49
|
+
}
|
50
|
+
END
|
51
|
+
end
|
50
52
|
|
51
53
|
it 'should not detect any problems' do
|
52
54
|
expect(problems).to be_empty
|
@@ -75,7 +77,7 @@ describe 'only_variable_string' do
|
|
75
77
|
end
|
76
78
|
|
77
79
|
it 'should unquote the variable' do
|
78
|
-
expect(manifest).to eq(
|
80
|
+
expect(manifest).to eq('$foo')
|
79
81
|
end
|
80
82
|
end
|
81
83
|
|
@@ -91,7 +93,7 @@ describe 'only_variable_string' do
|
|
91
93
|
end
|
92
94
|
|
93
95
|
it 'should unquoted the variable' do
|
94
|
-
expect(manifest).to eq(
|
96
|
+
expect(manifest).to eq('$foo[0]')
|
95
97
|
end
|
96
98
|
end
|
97
99
|
|
@@ -107,7 +109,7 @@ describe 'only_variable_string' do
|
|
107
109
|
end
|
108
110
|
|
109
111
|
it 'should unquote the variable' do
|
110
|
-
expect(manifest).to eq(
|
112
|
+
expect(manifest).to eq('$foo[0][aoeuaoeu][bar][999]')
|
111
113
|
end
|
112
114
|
end
|
113
115
|
end
|
@@ -50,13 +50,12 @@ describe 'puppet_url_without_modules' do
|
|
50
50
|
end
|
51
51
|
end
|
52
52
|
end
|
53
|
-
|
53
|
+
|
54
54
|
context 'double string wrapped puppet:// urls' do
|
55
55
|
let(:code) { File.read('spec/fixtures/test/manifests/url_interpolation.pp') }
|
56
56
|
|
57
57
|
it 'should detect several problems' do
|
58
58
|
expect(problems).to have(4).problem
|
59
59
|
end
|
60
|
-
|
61
60
|
end
|
62
61
|
end
|
@@ -16,25 +16,29 @@ describe 'single_quote_string_with_variables' do
|
|
16
16
|
end
|
17
17
|
|
18
18
|
context 'single quoted inline template with dollar signs has no problems' do
|
19
|
-
let
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
19
|
+
let(:code) do
|
20
|
+
<<-END
|
21
|
+
$list = ['one', 'two', 'three']
|
22
|
+
file { '/tmp/text.txt':
|
23
|
+
ensure => file,
|
24
|
+
content => inline_template('<% $list.each |$item| { %><%= "${item}\n" %><% } %>'),
|
25
|
+
}
|
26
|
+
END
|
27
|
+
end
|
26
28
|
|
27
29
|
it { expect(problems).to have(0).problem }
|
28
30
|
end
|
29
31
|
|
30
32
|
context 'single quoted inline epp with dollar signs has no problems' do
|
31
|
-
let
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
33
|
+
let(:code) do
|
34
|
+
<<-END
|
35
|
+
$list = ['one', 'two', 'three']
|
36
|
+
file { '/tmp/text.txt':
|
37
|
+
ensure => file,
|
38
|
+
content => inline_template('<% @list.each do |item| %><%= @item %>\n<% end %>'),
|
39
|
+
}
|
40
|
+
END
|
41
|
+
end
|
38
42
|
|
39
43
|
it { expect(problems).to have(0).problem }
|
40
44
|
end
|
@@ -1,15 +1,18 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
+
|
2
3
|
require 'spec_helper'
|
3
4
|
|
4
5
|
describe '140chars' do
|
5
6
|
let(:msg) { 'line has more than 140 characters' }
|
6
7
|
|
7
8
|
context 'file resource with a source line > 140c' do
|
8
|
-
let(:code)
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
let(:code) do
|
10
|
+
<<-END
|
11
|
+
file {
|
12
|
+
source => 'puppet:///modules/certificates/etc/ssl/private/wildcard.example.com.crt',
|
13
|
+
}
|
14
|
+
END
|
15
|
+
end
|
13
16
|
|
14
17
|
it 'should not detect any problems' do
|
15
18
|
expect(problems).to have(0).problems
|
@@ -17,11 +20,13 @@ describe '140chars' do
|
|
17
20
|
end
|
18
21
|
|
19
22
|
context 'file resource with a template line > 140c' do
|
20
|
-
let(:code)
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
23
|
+
let(:code) do
|
24
|
+
<<-END
|
25
|
+
file {
|
26
|
+
content => template('mymodule/this/is/a/truely/absurdly/long/path/that/should/make/you/feel/bad'),
|
27
|
+
}
|
28
|
+
END
|
29
|
+
end
|
25
30
|
|
26
31
|
it 'should not detect any problems' do
|
27
32
|
expect(problems).to have(0).problems
|
@@ -29,11 +34,13 @@ describe '140chars' do
|
|
29
34
|
end
|
30
35
|
|
31
36
|
context 'length of lines with UTF-8 characters' do
|
32
|
-
let(:code)
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
+
let(:code) do
|
38
|
+
<<-END
|
39
|
+
# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
40
|
+
# ┃ Configuration ┃
|
41
|
+
# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛"
|
42
|
+
END
|
43
|
+
end
|
37
44
|
|
38
45
|
it 'should not detect any problems' do
|
39
46
|
expect(problems).to have(0).problems
|
@@ -4,18 +4,20 @@ describe '2sp_soft_tabs' do
|
|
4
4
|
let(:msg) { 'two-space soft tabs not used' }
|
5
5
|
|
6
6
|
context 'when a line is indented by 3 spaces' do
|
7
|
-
let(:code)
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
7
|
+
let(:code) do
|
8
|
+
<<-END
|
9
|
+
file { 'foo':
|
10
|
+
foo => bar,
|
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 an error' do
|
18
|
-
expect(problems).to contain_error(msg).on_line(
|
20
|
+
expect(problems).to contain_error(msg).on_line(2).in_column(1)
|
19
21
|
end
|
20
22
|
end
|
21
23
|
end
|
@@ -1,19 +1,22 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
+
|
2
3
|
require 'spec_helper'
|
3
4
|
|
4
5
|
describe '80chars' do
|
5
6
|
before do
|
6
|
-
PuppetLint.configuration.send(
|
7
|
+
PuppetLint.configuration.send('enable_80chars')
|
7
8
|
end
|
8
9
|
|
9
10
|
let(:msg) { 'line has more than 80 characters' }
|
10
11
|
|
11
12
|
context 'file resource with a source line > 80c' do
|
12
|
-
let(:code)
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
let(:code) do
|
14
|
+
<<-END
|
15
|
+
file {
|
16
|
+
source => 'puppet:///modules/certificates/etc/ssl/private/wildcard.example.com.crt',
|
17
|
+
}
|
18
|
+
END
|
19
|
+
end
|
17
20
|
|
18
21
|
it 'should not detect any problems' do
|
19
22
|
expect(problems).to have(0).problems
|
@@ -21,11 +24,13 @@ describe '80chars' do
|
|
21
24
|
end
|
22
25
|
|
23
26
|
context 'file resource with a template line > 80c' do
|
24
|
-
let(:code)
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
27
|
+
let(:code) do
|
28
|
+
<<-END
|
29
|
+
file {
|
30
|
+
content => template('mymodule/this/is/a/truely/absurdly/long/path/that/should/make/you/feel/bad'),
|
31
|
+
}
|
32
|
+
END
|
33
|
+
end
|
29
34
|
|
30
35
|
it 'should not detect any problems' do
|
31
36
|
expect(problems).to have(0).problems
|
@@ -33,11 +38,13 @@ describe '80chars' do
|
|
33
38
|
end
|
34
39
|
|
35
40
|
context 'length of lines with UTF-8 characters' do
|
36
|
-
let(:code)
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
+
let(:code) do
|
42
|
+
<<-END
|
43
|
+
# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
|
44
|
+
# ┃ Configuration ┃
|
45
|
+
# ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛"
|
46
|
+
END
|
47
|
+
end
|
41
48
|
|
42
49
|
it 'should not detect any problems' do
|
43
50
|
expect(problems).to have(0).problems
|
@@ -55,17 +62,4 @@ describe '80chars' do
|
|
55
62
|
expect(problems).to contain_warning(msg).on_line(1).in_column(80)
|
56
63
|
end
|
57
64
|
end
|
58
|
-
|
59
|
-
# TODO: figure out why rspec keeps enabling this check!
|
60
|
-
#
|
61
|
-
# context '81 character line with disabled check' do
|
62
|
-
# let(:code) { 'a' * 81 }
|
63
|
-
#
|
64
|
-
# PuppetLint.configuration.send("disable_80chars")
|
65
|
-
#
|
66
|
-
# it 'should not detect any problems' do
|
67
|
-
# expect(problems).to have(0).problem
|
68
|
-
# end
|
69
|
-
# end
|
70
|
-
|
71
65
|
end
|
@@ -5,16 +5,18 @@ describe 'arrow_alignment' do
|
|
5
5
|
|
6
6
|
context 'with fix disabled' do
|
7
7
|
context 'selectors inside a resource' do
|
8
|
-
let(:code)
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
8
|
+
let(:code) do
|
9
|
+
<<-END
|
10
|
+
file { 'foo':
|
11
|
+
ensure => $ensure,
|
12
|
+
require => $ensure ? {
|
13
|
+
present => Class['tomcat::install'],
|
14
|
+
absent => undef;
|
15
|
+
},
|
16
|
+
foo => bar,
|
17
|
+
}
|
18
|
+
END
|
19
|
+
end
|
18
20
|
|
19
21
|
it 'should not detect any problems' do
|
20
22
|
expect(problems).to have(0).problems
|
@@ -22,15 +24,17 @@ describe 'arrow_alignment' do
|
|
22
24
|
end
|
23
25
|
|
24
26
|
context 'selectors in the middle of a resource' do
|
25
|
-
let(:code)
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
27
|
+
let(:code) do
|
28
|
+
<<-END
|
29
|
+
file { 'foo':
|
30
|
+
ensure => $ensure ? {
|
31
|
+
present => directory,
|
32
|
+
absent => undef,
|
33
|
+
},
|
34
|
+
owner => 'tomcat6',
|
35
|
+
}
|
36
|
+
END
|
37
|
+
end
|
34
38
|
|
35
39
|
it 'should not detect any problems' do
|
36
40
|
expect(problems).to have(0).problems
|
@@ -38,14 +42,17 @@ describe 'arrow_alignment' do
|
|
38
42
|
end
|
39
43
|
|
40
44
|
context 'selector inside a resource' do
|
41
|
-
let(:code)
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
45
|
+
let(:code) do
|
46
|
+
<<-END
|
47
|
+
ensure => $ensure ? {
|
48
|
+
present => directory,
|
49
|
+
absent => undef,
|
50
|
+
},
|
51
|
+
owner => 'foo4',
|
52
|
+
group => 'foo4',
|
53
|
+
mode => '0755',
|
54
|
+
END
|
55
|
+
end
|
49
56
|
|
50
57
|
it 'should not detect any problems' do
|
51
58
|
expect(problems).to have(0).problems
|
@@ -53,17 +60,20 @@ describe 'arrow_alignment' do
|
|
53
60
|
end
|
54
61
|
|
55
62
|
context 'selector inside a hash inside a resource' do
|
56
|
-
let(:code)
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
63
|
+
let(:code) do
|
64
|
+
<<-END
|
65
|
+
server => {
|
66
|
+
ensure => ensure => $ensure ? {
|
67
|
+
present => directory,
|
68
|
+
absent => undef,
|
69
|
+
},
|
70
|
+
ip => '192.168.1.1'
|
71
|
+
},
|
72
|
+
owner => 'foo4',
|
73
|
+
group => 'foo4',
|
74
|
+
mode => '0755',
|
75
|
+
END
|
76
|
+
end
|
67
77
|
|
68
78
|
it 'should not detect any problems' do
|
69
79
|
expect(problems).to have(0).problems
|
@@ -71,32 +81,34 @@ describe 'arrow_alignment' do
|
|
71
81
|
end
|
72
82
|
|
73
83
|
context 'nested hashes with correct indentation' do
|
74
|
-
let(:code)
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
84
|
+
let(:code) do
|
85
|
+
<<-END
|
86
|
+
class { 'lvs::base':
|
87
|
+
virtualeservers => {
|
88
|
+
'192.168.2.13' => {
|
89
|
+
vport => '11025',
|
90
|
+
service => 'smtp',
|
91
|
+
scheduler => 'wlc',
|
92
|
+
protocol => 'tcp',
|
93
|
+
checktype => 'external',
|
94
|
+
checkcommand => '/path/to/checkscript',
|
95
|
+
real_servers => {
|
96
|
+
'server01' => {
|
97
|
+
real_server => '192.168.2.14',
|
98
|
+
real_port => '25',
|
99
|
+
forwarding => 'masq',
|
100
|
+
},
|
101
|
+
'server02' => {
|
102
|
+
real_server => '192.168.2.15',
|
103
|
+
real_port => '25',
|
104
|
+
forwarding => 'masq',
|
105
|
+
}
|
94
106
|
}
|
95
107
|
}
|
96
108
|
}
|
97
109
|
}
|
98
|
-
|
99
|
-
|
110
|
+
END
|
111
|
+
end
|
100
112
|
|
101
113
|
it 'should not detect any problems' do
|
102
114
|
expect(problems).to have(0).problems
|
@@ -104,128 +116,141 @@ describe 'arrow_alignment' do
|
|
104
116
|
end
|
105
117
|
|
106
118
|
context 'single resource with a misaligned =>' do
|
107
|
-
let(:code)
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
119
|
+
let(:code) do
|
120
|
+
<<-END
|
121
|
+
file { '/tmp/foo':
|
122
|
+
foo => 1,
|
123
|
+
bar => 2,
|
124
|
+
gronk => 3,
|
125
|
+
baz => 4,
|
126
|
+
meh => 5,
|
127
|
+
}
|
128
|
+
END
|
129
|
+
end
|
116
130
|
|
117
131
|
it 'should detect four problems' do
|
118
132
|
expect(problems).to have(4).problems
|
119
133
|
end
|
120
134
|
|
121
135
|
it 'should create four warnings' do
|
122
|
-
expect(problems).to contain_warning(
|
123
|
-
expect(problems).to contain_warning(
|
124
|
-
expect(problems).to contain_warning(
|
125
|
-
expect(problems).to contain_warning(
|
136
|
+
expect(problems).to contain_warning(format(msg, 19, 17)).on_line(2).in_column(17)
|
137
|
+
expect(problems).to contain_warning(format(msg, 19, 17)).on_line(3).in_column(17)
|
138
|
+
expect(problems).to contain_warning(format(msg, 19, 18)).on_line(5).in_column(18)
|
139
|
+
expect(problems).to contain_warning(format(msg, 19, 17)).on_line(6).in_column(17)
|
126
140
|
end
|
127
141
|
end
|
128
142
|
|
129
143
|
context 'single resource with a misaligned => and semicolon at the end' do
|
130
|
-
let(:code)
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
144
|
+
let(:code) do
|
145
|
+
<<-END
|
146
|
+
file { '/tmp/bar':
|
147
|
+
foo => 1,
|
148
|
+
bar => 2,
|
149
|
+
gronk => 3,
|
150
|
+
baz => 4,
|
151
|
+
meh => 5;
|
152
|
+
}
|
153
|
+
END
|
154
|
+
end
|
139
155
|
|
140
156
|
it 'should detect four problems' do
|
141
157
|
expect(problems).to have(4).problems
|
142
158
|
end
|
143
159
|
|
144
160
|
it 'should create four warnings' do
|
145
|
-
expect(problems).to contain_warning(
|
146
|
-
expect(problems).to contain_warning(
|
147
|
-
expect(problems).to contain_warning(
|
148
|
-
expect(problems).to contain_warning(
|
161
|
+
expect(problems).to contain_warning(format(msg, 19, 17)).on_line(2).in_column(17)
|
162
|
+
expect(problems).to contain_warning(format(msg, 19, 17)).on_line(3).in_column(17)
|
163
|
+
expect(problems).to contain_warning(format(msg, 19, 18)).on_line(5).in_column(18)
|
164
|
+
expect(problems).to contain_warning(format(msg, 19, 17)).on_line(6).in_column(17)
|
149
165
|
end
|
150
166
|
end
|
167
|
+
|
151
168
|
context 'complex resource with a misaligned =>' do
|
152
|
-
let(:code)
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
169
|
+
let(:code) do
|
170
|
+
<<-END
|
171
|
+
file { '/tmp/foo':
|
172
|
+
foo => 1,
|
173
|
+
bar => $baz ? {
|
174
|
+
gronk => 2,
|
175
|
+
meh => 3,
|
176
|
+
},
|
177
|
+
meep => 4,
|
178
|
+
bah => 5,
|
179
|
+
}
|
180
|
+
END
|
181
|
+
end
|
163
182
|
|
164
183
|
it 'should detect three problems' do
|
165
184
|
expect(problems).to have(3).problems
|
166
185
|
end
|
167
186
|
|
168
187
|
it 'should create three warnings' do
|
169
|
-
expect(problems).to contain_warning(
|
170
|
-
expect(problems).to contain_warning(
|
171
|
-
expect(problems).to contain_warning(
|
188
|
+
expect(problems).to contain_warning(format(msg, 18, 17)).on_line(2).in_column(17)
|
189
|
+
expect(problems).to contain_warning(format(msg, 21, 19)).on_line(5).in_column(19)
|
190
|
+
expect(problems).to contain_warning(format(msg, 18, 17)).on_line(8).in_column(17)
|
172
191
|
end
|
173
192
|
end
|
174
193
|
|
175
194
|
context 'multi-resource with a misaligned =>' do
|
176
|
-
let(:code)
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
195
|
+
let(:code) do
|
196
|
+
<<-END
|
197
|
+
file {
|
198
|
+
'/tmp/foo': ;
|
199
|
+
'/tmp/bar':
|
200
|
+
foo => 'bar';
|
201
|
+
'/tmp/baz':
|
202
|
+
gronk => 'bah',
|
203
|
+
meh => 'no'
|
204
|
+
}
|
205
|
+
END
|
206
|
+
end
|
186
207
|
|
187
208
|
it 'should only detect a single problem' do
|
188
209
|
expect(problems).to have(1).problem
|
189
210
|
end
|
190
211
|
|
191
212
|
it 'should create a warning' do
|
192
|
-
expect(problems).to contain_warning(
|
213
|
+
expect(problems).to contain_warning(format(msg, 21, 19)).on_line(7).in_column(19)
|
193
214
|
end
|
194
215
|
end
|
195
216
|
|
196
217
|
context 'multi-resource with a misaligned => and semicolons' do
|
197
|
-
let(:code)
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
218
|
+
let(:code) do
|
219
|
+
<<-END
|
220
|
+
file {
|
221
|
+
'/tmp/foo':
|
222
|
+
ensure => 'directory',
|
223
|
+
owner => 'root',
|
224
|
+
mode => '0755';
|
225
|
+
'/tmp/bar':
|
226
|
+
ensure => 'directory';
|
227
|
+
'/tmp/baz':
|
228
|
+
ensure => 'directory',
|
229
|
+
owner => 'root',
|
230
|
+
mode => '0755';
|
231
|
+
}
|
232
|
+
END
|
233
|
+
end
|
211
234
|
|
212
235
|
it 'should only detect a single problem' do
|
213
236
|
expect(problems).to have(4).problem
|
214
237
|
end
|
215
238
|
|
216
239
|
it 'should create a warning' do
|
217
|
-
expect(problems).to contain_warning(
|
218
|
-
expect(problems).to contain_warning(
|
219
|
-
expect(problems).to contain_warning(
|
220
|
-
expect(problems).to contain_warning(
|
240
|
+
expect(problems).to contain_warning(format(msg, 22, 21)).on_line(4).in_column(21)
|
241
|
+
expect(problems).to contain_warning(format(msg, 22, 20)).on_line(5).in_column(20)
|
242
|
+
expect(problems).to contain_warning(format(msg, 22, 21)).on_line(10).in_column(21)
|
243
|
+
expect(problems).to contain_warning(format(msg, 22, 20)).on_line(11).in_column(20)
|
221
244
|
end
|
222
245
|
end
|
223
246
|
|
224
247
|
context 'multiple single line resources' do
|
225
|
-
let(:code)
|
226
|
-
|
227
|
-
|
228
|
-
|
248
|
+
let(:code) do
|
249
|
+
<<-END
|
250
|
+
file { 'foo': ensure => file }
|
251
|
+
package { 'bar': ensure => present }
|
252
|
+
END
|
253
|
+
end
|
229
254
|
|
230
255
|
it 'should not detect any problems' do
|
231
256
|
expect(problems).to have(0).problems
|
@@ -233,12 +258,14 @@ describe 'arrow_alignment' do
|
|
233
258
|
end
|
234
259
|
|
235
260
|
context 'resource with unaligned => in commented line' do
|
236
|
-
let(:code)
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
261
|
+
let(:code) do
|
262
|
+
<<-END
|
263
|
+
file { 'foo':
|
264
|
+
ensure => directory,
|
265
|
+
# purge => true,
|
266
|
+
}
|
267
|
+
END
|
268
|
+
end
|
242
269
|
|
243
270
|
it 'should not detect any problems' do
|
244
271
|
expect(problems).to have(0).problems
|
@@ -246,11 +273,13 @@ describe 'arrow_alignment' do
|
|
246
273
|
end
|
247
274
|
|
248
275
|
context 'single line resource spread out on multiple lines' do
|
249
|
-
let(:code)
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
276
|
+
let(:code) do
|
277
|
+
<<-END
|
278
|
+
file {
|
279
|
+
'foo': ensure => present,
|
280
|
+
}
|
281
|
+
END
|
282
|
+
end
|
254
283
|
|
255
284
|
it 'should not detect any problems' do
|
256
285
|
expect(problems).to have(0).problems
|
@@ -258,11 +287,13 @@ describe 'arrow_alignment' do
|
|
258
287
|
end
|
259
288
|
|
260
289
|
context 'multiline resource with a single line of params' do
|
261
|
-
let(:code)
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
290
|
+
let(:code) do
|
291
|
+
<<-END
|
292
|
+
mymodule::do_thing { 'some thing':
|
293
|
+
whatever => { foo => 'bar', one => 'two' },
|
294
|
+
}
|
295
|
+
END
|
296
|
+
end
|
266
297
|
|
267
298
|
it 'should not detect any problems' do
|
268
299
|
expect(problems).to have(0).problems
|
@@ -270,31 +301,35 @@ describe 'arrow_alignment' do
|
|
270
301
|
end
|
271
302
|
|
272
303
|
context 'resource with aligned => too far out' do
|
273
|
-
let(:code)
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
304
|
+
let(:code) do
|
305
|
+
<<-END
|
306
|
+
file { '/tmp/foo':
|
307
|
+
ensure => file,
|
308
|
+
mode => '0444',
|
309
|
+
}
|
310
|
+
END
|
311
|
+
end
|
279
312
|
|
280
313
|
it 'should detect 2 problems' do
|
281
314
|
expect(problems).to have(2).problems
|
282
315
|
end
|
283
316
|
|
284
317
|
it 'should create 2 warnings' do
|
285
|
-
expect(problems).to contain_warning(
|
286
|
-
expect(problems).to contain_warning(
|
318
|
+
expect(problems).to contain_warning(format(msg, 20, 21)).on_line(2).in_column(21)
|
319
|
+
expect(problems).to contain_warning(format(msg, 20, 21)).on_line(3).in_column(21)
|
287
320
|
end
|
288
321
|
end
|
289
322
|
|
290
323
|
context 'resource with multiple params where one is an empty hash' do
|
291
|
-
let(:code)
|
292
|
-
|
293
|
-
|
294
|
-
|
324
|
+
let(:code) do
|
325
|
+
<<-END
|
326
|
+
foo { 'foo':
|
327
|
+
a => true,
|
328
|
+
b => {
|
329
|
+
}
|
295
330
|
}
|
296
|
-
|
297
|
-
|
331
|
+
END
|
332
|
+
end
|
298
333
|
|
299
334
|
it 'should not detect any problems' do
|
300
335
|
expect(problems).to have(0).problems
|
@@ -302,30 +337,34 @@ describe 'arrow_alignment' do
|
|
302
337
|
end
|
303
338
|
|
304
339
|
context 'multiline resource with multiple params on a line' do
|
305
|
-
let(:code)
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
340
|
+
let(:code) do
|
341
|
+
<<-END
|
342
|
+
user { 'test':
|
343
|
+
a => 'foo', bb => 'bar',
|
344
|
+
ccc => 'baz',
|
345
|
+
}
|
346
|
+
END
|
347
|
+
end
|
311
348
|
|
312
349
|
it 'should detect 2 problems' do
|
313
350
|
expect(problems).to have(2).problems
|
314
351
|
end
|
315
352
|
|
316
353
|
it 'should create 2 warnings' do
|
317
|
-
expect(problems).to contain_warning(
|
318
|
-
expect(problems).to contain_warning(
|
354
|
+
expect(problems).to contain_warning(format(msg, 17, 15)).on_line(2).in_column(15)
|
355
|
+
expect(problems).to contain_warning(format(msg, 17, 28)).on_line(2).in_column(28)
|
319
356
|
end
|
320
357
|
end
|
321
358
|
|
322
359
|
context 'resource param containing a single-element same-line hash' do
|
323
|
-
let(:code)
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
360
|
+
let(:code) do
|
361
|
+
<<-END
|
362
|
+
foo { 'foo':
|
363
|
+
a => true,
|
364
|
+
b => { 'a' => 'b' }
|
365
|
+
}
|
366
|
+
END
|
367
|
+
end
|
329
368
|
|
330
369
|
it 'should not detect any problems' do
|
331
370
|
expect(problems).to have(0).problems
|
@@ -333,14 +372,16 @@ describe 'arrow_alignment' do
|
|
333
372
|
end
|
334
373
|
|
335
374
|
context 'multiline hash with opening brace on same line as first pair' do
|
336
|
-
let(:code)
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
375
|
+
let(:code) do
|
376
|
+
<<-END
|
377
|
+
foo { 'foo':
|
378
|
+
bar => [
|
379
|
+
{ aa => bb,
|
380
|
+
c => d},
|
381
|
+
],
|
382
|
+
}
|
383
|
+
END
|
384
|
+
end
|
344
385
|
|
345
386
|
it 'should not detect any problems' do
|
346
387
|
expect(problems).to have(0).problems
|
@@ -348,34 +389,38 @@ describe 'arrow_alignment' do
|
|
348
389
|
end
|
349
390
|
|
350
391
|
context 'unaligned multiline hash with opening brace on the same line as the first pair' do
|
351
|
-
let(:code)
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
392
|
+
let(:code) do
|
393
|
+
<<-END
|
394
|
+
foo { 'foo':
|
395
|
+
bar => [
|
396
|
+
{ aa => bb,
|
397
|
+
c => d},
|
398
|
+
],
|
399
|
+
}
|
400
|
+
END
|
401
|
+
end
|
359
402
|
|
360
403
|
it 'should detect one problem' do
|
361
404
|
expect(problems).to have(1).problem
|
362
405
|
end
|
363
406
|
|
364
407
|
it 'should create one warning' do
|
365
|
-
expect(problems).to contain_warning(
|
408
|
+
expect(problems).to contain_warning(format(msg, 20, 19)).on_line(4).in_column(19)
|
366
409
|
end
|
367
410
|
end
|
368
411
|
|
369
412
|
context 'hash with strings containing variables as keys properly aligned' do
|
370
|
-
let(:code)
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
413
|
+
let(:code) do
|
414
|
+
<<-END
|
415
|
+
foo { foo:
|
416
|
+
param => {
|
417
|
+
a => 1
|
418
|
+
"${aoeu}" => 2,
|
419
|
+
b => 3,
|
420
|
+
},
|
421
|
+
}
|
422
|
+
END
|
423
|
+
end
|
379
424
|
|
380
425
|
it 'should not detect any problems' do
|
381
426
|
expect(problems).to have(0).problems
|
@@ -383,42 +428,46 @@ describe 'arrow_alignment' do
|
|
383
428
|
end
|
384
429
|
|
385
430
|
context 'hash with strings containing variables as keys incorrectly aligned' do
|
386
|
-
let(:code)
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
431
|
+
let(:code) do
|
432
|
+
<<-END
|
433
|
+
foo { foo:
|
434
|
+
param => {
|
435
|
+
a => 1
|
436
|
+
"${aoeu}" => 2,
|
437
|
+
b => 3,
|
438
|
+
},
|
439
|
+
}
|
440
|
+
END
|
441
|
+
end
|
395
442
|
|
396
443
|
it 'should detect 2 problems' do
|
397
444
|
expect(problems).to have(2).problems
|
398
445
|
end
|
399
446
|
|
400
447
|
it 'should create 2 warnings' do
|
401
|
-
expect(problems).to contain_warning(
|
402
|
-
expect(problems).to contain_warning(
|
448
|
+
expect(problems).to contain_warning(format(msg, 25, 17)).on_line(3).in_column(17)
|
449
|
+
expect(problems).to contain_warning(format(msg, 25, 21)).on_line(5).in_column(21)
|
403
450
|
end
|
404
451
|
end
|
405
452
|
|
406
453
|
context 'complex data structure with different indentation levels at the same depth' do
|
407
|
-
let(:code)
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
'
|
412
|
-
|
413
|
-
'an_array' => [
|
414
|
-
{
|
415
|
-
foo => 'bar',
|
416
|
-
bar => 'baz',
|
454
|
+
let(:code) do
|
455
|
+
<<-END
|
456
|
+
class { 'some_class':
|
457
|
+
config_hash => {
|
458
|
+
'a_hash' => {
|
459
|
+
'foo' => 'bar',
|
417
460
|
},
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
461
|
+
'an_array' => [
|
462
|
+
{
|
463
|
+
foo => 'bar',
|
464
|
+
bar => 'baz',
|
465
|
+
},
|
466
|
+
],
|
467
|
+
},
|
468
|
+
}
|
469
|
+
END
|
470
|
+
end
|
422
471
|
|
423
472
|
it 'should not detect any problems' do
|
424
473
|
expect(problems).to have(0).problems
|
@@ -426,16 +475,18 @@ describe 'arrow_alignment' do
|
|
426
475
|
end
|
427
476
|
|
428
477
|
context 'where the top level of the block has no parameters' do
|
429
|
-
let(:code)
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
478
|
+
let(:code) do
|
479
|
+
<<-END
|
480
|
+
case $::osfamily {
|
481
|
+
'RedHat': {
|
482
|
+
$datadir = $::operatingsystem ? {
|
483
|
+
'Amazon' => pick($datadir, 'value'),
|
484
|
+
default => pick($datadir, 'value'),
|
485
|
+
}
|
435
486
|
}
|
436
487
|
}
|
437
|
-
|
438
|
-
|
488
|
+
END
|
489
|
+
end
|
439
490
|
|
440
491
|
it 'should not detect any problems' do
|
441
492
|
expect(problems).to have(0).problems
|
@@ -453,34 +504,39 @@ describe 'arrow_alignment' do
|
|
453
504
|
end
|
454
505
|
|
455
506
|
context 'single resource with a misaligned =>' do
|
456
|
-
let(:code)
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
507
|
+
let(:code) do
|
508
|
+
<<-END
|
509
|
+
file { '/tmp/foo':
|
510
|
+
foo => 1,
|
511
|
+
bar => 2,
|
512
|
+
gronk => 3,
|
513
|
+
baz => 4,
|
514
|
+
meh => 5,
|
515
|
+
}
|
516
|
+
END
|
517
|
+
end
|
518
|
+
|
519
|
+
let(:fixed) do
|
520
|
+
<<-END
|
521
|
+
file { '/tmp/foo':
|
522
|
+
foo => 1,
|
523
|
+
bar => 2,
|
524
|
+
gronk => 3,
|
525
|
+
baz => 4,
|
526
|
+
meh => 5,
|
527
|
+
}
|
528
|
+
END
|
529
|
+
end
|
474
530
|
|
475
531
|
it 'should detect four problems' do
|
476
532
|
expect(problems).to have(4).problems
|
477
533
|
end
|
478
534
|
|
479
535
|
it 'should fix the manifest' do
|
480
|
-
expect(problems).to contain_fixed(
|
481
|
-
expect(problems).to contain_fixed(
|
482
|
-
expect(problems).to contain_fixed(
|
483
|
-
expect(problems).to contain_fixed(
|
536
|
+
expect(problems).to contain_fixed(format(msg, 19, 17)).on_line(2).in_column(17)
|
537
|
+
expect(problems).to contain_fixed(format(msg, 19, 17)).on_line(3).in_column(17)
|
538
|
+
expect(problems).to contain_fixed(format(msg, 19, 18)).on_line(5).in_column(18)
|
539
|
+
expect(problems).to contain_fixed(format(msg, 19, 17)).on_line(6).in_column(17)
|
484
540
|
end
|
485
541
|
|
486
542
|
it 'should align the arrows' do
|
@@ -489,37 +545,42 @@ describe 'arrow_alignment' do
|
|
489
545
|
end
|
490
546
|
|
491
547
|
context 'complex resource with a misaligned =>' do
|
492
|
-
let(:code)
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
548
|
+
let(:code) do
|
549
|
+
<<-END
|
550
|
+
file { '/tmp/foo':
|
551
|
+
foo => 1,
|
552
|
+
bar => $baz ? {
|
553
|
+
gronk => 2,
|
554
|
+
meh => 3,
|
555
|
+
},
|
556
|
+
meep => 4,
|
557
|
+
bah => 5,
|
558
|
+
}
|
559
|
+
END
|
560
|
+
end
|
561
|
+
|
562
|
+
let(:fixed) do
|
563
|
+
<<-END
|
564
|
+
file { '/tmp/foo':
|
565
|
+
foo => 1,
|
566
|
+
bar => $baz ? {
|
567
|
+
gronk => 2,
|
568
|
+
meh => 3,
|
569
|
+
},
|
570
|
+
meep => 4,
|
571
|
+
bah => 5,
|
572
|
+
}
|
573
|
+
END
|
574
|
+
end
|
514
575
|
|
515
576
|
it 'should detect three problems' do
|
516
577
|
expect(problems).to have(3).problems
|
517
578
|
end
|
518
579
|
|
519
580
|
it 'should fix the manifest' do
|
520
|
-
expect(problems).to contain_fixed(
|
521
|
-
expect(problems).to contain_fixed(
|
522
|
-
expect(problems).to contain_fixed(
|
581
|
+
expect(problems).to contain_fixed(format(msg, 18, 17)).on_line(2).in_column(17)
|
582
|
+
expect(problems).to contain_fixed(format(msg, 21, 19)).on_line(5).in_column(19)
|
583
|
+
expect(problems).to contain_fixed(format(msg, 18, 17)).on_line(8).in_column(17)
|
523
584
|
end
|
524
585
|
|
525
586
|
it 'should align the arrows' do
|
@@ -528,33 +589,38 @@ describe 'arrow_alignment' do
|
|
528
589
|
end
|
529
590
|
|
530
591
|
context 'multi-resource with a misaligned =>' do
|
531
|
-
let(:code)
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
592
|
+
let(:code) do
|
593
|
+
<<-END
|
594
|
+
file {
|
595
|
+
'/tmp/foo': ;
|
596
|
+
'/tmp/bar':
|
597
|
+
foo => 'bar';
|
598
|
+
'/tmp/baz':
|
599
|
+
gronk => 'bah',
|
600
|
+
meh => 'no'
|
601
|
+
}
|
602
|
+
END
|
603
|
+
end
|
604
|
+
|
605
|
+
let(:fixed) do
|
606
|
+
<<-END
|
607
|
+
file {
|
608
|
+
'/tmp/foo': ;
|
609
|
+
'/tmp/bar':
|
610
|
+
foo => 'bar';
|
611
|
+
'/tmp/baz':
|
612
|
+
gronk => 'bah',
|
613
|
+
meh => 'no'
|
614
|
+
}
|
615
|
+
END
|
616
|
+
end
|
551
617
|
|
552
618
|
it 'should only detect a single problem' do
|
553
619
|
expect(problems).to have(1).problem
|
554
620
|
end
|
555
621
|
|
556
622
|
it 'should fix the manifest' do
|
557
|
-
expect(problems).to contain_fixed(
|
623
|
+
expect(problems).to contain_fixed(format(msg, 21, 19)).on_line(7).in_column(19)
|
558
624
|
end
|
559
625
|
|
560
626
|
it 'should align the arrows' do
|
@@ -563,27 +629,31 @@ describe 'arrow_alignment' do
|
|
563
629
|
end
|
564
630
|
|
565
631
|
context 'resource with aligned => too far out' do
|
566
|
-
let(:code)
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
632
|
+
let(:code) do
|
633
|
+
<<-END
|
634
|
+
file { '/tmp/foo':
|
635
|
+
ensure => file,
|
636
|
+
mode => '0444',
|
637
|
+
}
|
638
|
+
END
|
639
|
+
end
|
640
|
+
|
641
|
+
let(:fixed) do
|
642
|
+
<<-END
|
643
|
+
file { '/tmp/foo':
|
644
|
+
ensure => file,
|
645
|
+
mode => '0444',
|
646
|
+
}
|
647
|
+
END
|
648
|
+
end
|
579
649
|
|
580
650
|
it 'should detect 2 problems' do
|
581
651
|
expect(problems).to have(2).problems
|
582
652
|
end
|
583
653
|
|
584
654
|
it 'should create 2 warnings' do
|
585
|
-
expect(problems).to contain_fixed(
|
586
|
-
expect(problems).to contain_fixed(
|
655
|
+
expect(problems).to contain_fixed(format(msg, 20, 21)).on_line(2).in_column(21)
|
656
|
+
expect(problems).to contain_fixed(format(msg, 20, 21)).on_line(3).in_column(21)
|
587
657
|
end
|
588
658
|
|
589
659
|
it 'should realign the arrows with the minimum whitespace' do
|
@@ -592,26 +662,30 @@ describe 'arrow_alignment' do
|
|
592
662
|
end
|
593
663
|
|
594
664
|
context 'resource with unaligned => and no whitespace between param and =>' do
|
595
|
-
let(:code)
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
665
|
+
let(:code) do
|
666
|
+
<<-END
|
667
|
+
user { 'test':
|
668
|
+
param1 => 'foo',
|
669
|
+
param2=> 'bar',
|
670
|
+
}
|
671
|
+
END
|
672
|
+
end
|
673
|
+
|
674
|
+
let(:fixed) do
|
675
|
+
<<-END
|
676
|
+
user { 'test':
|
677
|
+
param1 => 'foo',
|
678
|
+
param2 => 'bar',
|
679
|
+
}
|
680
|
+
END
|
681
|
+
end
|
608
682
|
|
609
683
|
it 'should detect 1 problem' do
|
610
684
|
expect(problems).to have(1).problem
|
611
685
|
end
|
612
686
|
|
613
687
|
it 'should fix the problem' do
|
614
|
-
expect(problems).to contain_fixed(
|
688
|
+
expect(problems).to contain_fixed(format(msg, 20, 19)).on_line(3).in_column(19)
|
615
689
|
end
|
616
690
|
|
617
691
|
it 'should add whitespace between the param and the arrow' do
|
@@ -620,28 +694,32 @@ describe 'arrow_alignment' do
|
|
620
694
|
end
|
621
695
|
|
622
696
|
context 'multiline resource with multiple params on a line' do
|
623
|
-
let(:code)
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
697
|
+
let(:code) do
|
698
|
+
<<-END
|
699
|
+
user { 'test':
|
700
|
+
a => 'foo', bb => 'bar',
|
701
|
+
ccc => 'baz',
|
702
|
+
}
|
703
|
+
END
|
704
|
+
end
|
705
|
+
|
706
|
+
let(:fixed) do
|
707
|
+
<<-END
|
708
|
+
user { 'test':
|
709
|
+
a => 'foo',
|
710
|
+
bb => 'bar',
|
711
|
+
ccc => 'baz',
|
712
|
+
}
|
713
|
+
END
|
714
|
+
end
|
637
715
|
|
638
716
|
it 'should detect 2 problems' do
|
639
717
|
expect(problems).to have(2).problems
|
640
718
|
end
|
641
719
|
|
642
720
|
it 'should fix 2 problems' do
|
643
|
-
expect(problems).to contain_fixed(
|
644
|
-
expect(problems).to contain_fixed(
|
721
|
+
expect(problems).to contain_fixed(format(msg, 17, 15)).on_line(2).in_column(15)
|
722
|
+
expect(problems).to contain_fixed(format(msg, 17, 28)).on_line(2).in_column(28)
|
645
723
|
end
|
646
724
|
|
647
725
|
it 'should move the extra param onto its own line and realign' do
|
@@ -650,64 +728,72 @@ describe 'arrow_alignment' do
|
|
650
728
|
end
|
651
729
|
|
652
730
|
context 'multiline resource with multiple params on a line, extra one longer' do
|
653
|
-
let(:code)
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
731
|
+
let(:code) do
|
732
|
+
<<-END
|
733
|
+
user { 'test':
|
734
|
+
a => 'foo', bbccc => 'bar',
|
735
|
+
ccc => 'baz',
|
736
|
+
}
|
737
|
+
END
|
738
|
+
end
|
739
|
+
|
740
|
+
let(:fixed) do
|
741
|
+
<<-END
|
742
|
+
user { 'test':
|
743
|
+
a => 'foo',
|
744
|
+
bbccc => 'bar',
|
745
|
+
ccc => 'baz',
|
746
|
+
}
|
747
|
+
END
|
748
|
+
end
|
667
749
|
|
668
750
|
it 'should detect 2 problems' do
|
669
751
|
expect(problems).to have(3).problems
|
670
752
|
end
|
671
753
|
|
672
754
|
it 'should fix 2 problems' do
|
673
|
-
expect(problems).to contain_fixed(
|
674
|
-
expect(problems).to contain_fixed(
|
675
|
-
expect(problems).to contain_fixed(
|
755
|
+
expect(problems).to contain_fixed(format(msg, 19, 15)).on_line(2).in_column(15)
|
756
|
+
expect(problems).to contain_fixed(format(msg, 19, 31)).on_line(2).in_column(31)
|
757
|
+
expect(problems).to contain_fixed(format(msg, 19, 17)).on_line(3).in_column(17)
|
676
758
|
end
|
677
759
|
|
678
760
|
it 'should move the extra param onto its own line and realign' do
|
679
761
|
expect(manifest).to eq(fixed)
|
680
762
|
end
|
681
763
|
end
|
682
|
-
|
764
|
+
|
683
765
|
context 'hash with strings containing variables as keys incorrectly aligned' do
|
684
|
-
let(:code)
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
param => {
|
696
|
-
a => 1
|
697
|
-
"${aoeu}" => 2,
|
698
|
-
b => 3,
|
699
|
-
},
|
700
|
-
}
|
701
|
-
' }
|
766
|
+
let(:code) do
|
767
|
+
<<-END
|
768
|
+
foo { foo:
|
769
|
+
param => {
|
770
|
+
a => 1
|
771
|
+
"${aoeu}" => 2,
|
772
|
+
b => 3,
|
773
|
+
},
|
774
|
+
}
|
775
|
+
END
|
776
|
+
end
|
702
777
|
|
778
|
+
let(:fixed) do
|
779
|
+
<<-END
|
780
|
+
foo { foo:
|
781
|
+
param => {
|
782
|
+
a => 1
|
783
|
+
"${aoeu}" => 2,
|
784
|
+
b => 3,
|
785
|
+
},
|
786
|
+
}
|
787
|
+
END
|
788
|
+
end
|
703
789
|
|
704
790
|
it 'should detect 2 problems' do
|
705
791
|
expect(problems).to have(2).problems
|
706
792
|
end
|
707
793
|
|
708
794
|
it 'should fix 2 problems' do
|
709
|
-
expect(problems).to contain_fixed(
|
710
|
-
expect(problems).to contain_fixed(
|
795
|
+
expect(problems).to contain_fixed(format(msg, 25, 17)).on_line(3).in_column(17)
|
796
|
+
expect(problems).to contain_fixed(format(msg, 25, 21)).on_line(5).in_column(21)
|
711
797
|
end
|
712
798
|
|
713
799
|
it 'should align the hash rockets' do
|
@@ -716,44 +802,48 @@ describe 'arrow_alignment' do
|
|
716
802
|
end
|
717
803
|
|
718
804
|
context 'complex data structure with different indentation levels at the same depth' do
|
719
|
-
let(:code)
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
'
|
724
|
-
|
725
|
-
'an_array' => [
|
726
|
-
{
|
727
|
-
foo => 'bar',
|
728
|
-
bar => 'baz',
|
805
|
+
let(:code) do
|
806
|
+
<<-END
|
807
|
+
class { 'some_class':
|
808
|
+
config_hash => {
|
809
|
+
'a_hash' => {
|
810
|
+
'foo' => 'bar',
|
729
811
|
},
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
class { 'some_class':
|
737
|
-
config_hash => {
|
738
|
-
'a_hash' => {
|
739
|
-
'foo' => 'bar',
|
812
|
+
'an_array' => [
|
813
|
+
{
|
814
|
+
foo => 'bar',
|
815
|
+
bar => 'baz',
|
816
|
+
},
|
817
|
+
],
|
740
818
|
},
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
819
|
+
}
|
820
|
+
END
|
821
|
+
end
|
822
|
+
|
823
|
+
let(:fixed) do
|
824
|
+
<<-END
|
825
|
+
class { 'some_class':
|
826
|
+
config_hash => {
|
827
|
+
'a_hash' => {
|
828
|
+
'foo' => 'bar',
|
745
829
|
},
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
830
|
+
'an_array' => [
|
831
|
+
{
|
832
|
+
foo => 'bar',
|
833
|
+
bar => 'baz',
|
834
|
+
},
|
835
|
+
],
|
836
|
+
},
|
837
|
+
}
|
838
|
+
END
|
839
|
+
end
|
750
840
|
|
751
841
|
it 'should detect 1 problem' do
|
752
842
|
expect(problems).to have(1).problems
|
753
843
|
end
|
754
844
|
|
755
845
|
it 'should fix 1 problem' do
|
756
|
-
expect(problems).to contain_fixed(
|
846
|
+
expect(problems).to contain_fixed(format(msg, 23, 24)).on_line(9).in_column(24)
|
757
847
|
end
|
758
848
|
|
759
849
|
it 'should align the hash rockets' do
|
@@ -762,58 +852,60 @@ describe 'arrow_alignment' do
|
|
762
852
|
end
|
763
853
|
|
764
854
|
context 'complex data structure with multiple token keys' do
|
765
|
-
let(:code)
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
855
|
+
let(:code) do
|
856
|
+
<<-END.gsub(%r{^ {10}}, '')
|
857
|
+
class example (
|
858
|
+
$external_ip_base,
|
859
|
+
) {
|
860
|
+
|
861
|
+
bar { 'xxxxxxxxx':
|
862
|
+
inputs => {
|
863
|
+
'ny' => {
|
864
|
+
"${external_ip_base}.16:443 ${a} ${b} ${c}" => 'foo',
|
865
|
+
'veryveryverylongstring8:443'=> 'foo',
|
866
|
+
'simple'=> 'foo',
|
867
|
+
'3'=> :foo,
|
868
|
+
:baz=> :qux,
|
869
|
+
3=> 3,
|
870
|
+
},
|
779
871
|
},
|
780
|
-
}
|
872
|
+
}
|
781
873
|
}
|
782
|
-
}
|
783
874
|
END
|
784
|
-
|
785
|
-
|
786
|
-
let(:fixed) { <<-END.gsub(/^ {8}/, '')
|
787
|
-
class example (
|
788
|
-
$external_ip_base,
|
789
|
-
) {
|
875
|
+
end
|
790
876
|
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
877
|
+
let(:fixed) do
|
878
|
+
<<-END.gsub(%r{^ {10}}, '')
|
879
|
+
class example (
|
880
|
+
$external_ip_base,
|
881
|
+
) {
|
882
|
+
|
883
|
+
bar { 'xxxxxxxxx':
|
884
|
+
inputs => {
|
885
|
+
'ny' => {
|
886
|
+
"${external_ip_base}.16:443 ${a} ${b} ${c}" => 'foo',
|
887
|
+
'veryveryverylongstring8:443' => 'foo',
|
888
|
+
'simple' => 'foo',
|
889
|
+
'3' => :foo,
|
890
|
+
:baz => :qux,
|
891
|
+
3 => 3,
|
892
|
+
},
|
800
893
|
},
|
801
|
-
}
|
894
|
+
}
|
802
895
|
}
|
803
|
-
}
|
804
896
|
END
|
805
|
-
|
897
|
+
end
|
806
898
|
|
807
899
|
it 'should detect 5 problems' do
|
808
900
|
expect(problems).to have(5).problems
|
809
901
|
end
|
810
902
|
|
811
903
|
it 'should fix 5 problems' do
|
812
|
-
expect(problems).to contain_fixed(
|
813
|
-
expect(problems).to contain_fixed(
|
814
|
-
expect(problems).to contain_fixed(
|
815
|
-
expect(problems).to contain_fixed(
|
816
|
-
expect(problems).to contain_fixed(
|
904
|
+
expect(problems).to contain_fixed(format(msg, 53, 38)).on_line(9).in_column(38)
|
905
|
+
expect(problems).to contain_fixed(format(msg, 53, 17)).on_line(10).in_column(17)
|
906
|
+
expect(problems).to contain_fixed(format(msg, 53, 12)).on_line(11).in_column(12)
|
907
|
+
expect(problems).to contain_fixed(format(msg, 53, 13)).on_line(12).in_column(13)
|
908
|
+
expect(problems).to contain_fixed(format(msg, 53, 10)).on_line(13).in_column(10)
|
817
909
|
end
|
818
910
|
|
819
911
|
it 'should realign the arrows' do
|
@@ -822,51 +914,53 @@ describe 'arrow_alignment' do
|
|
822
914
|
end
|
823
915
|
|
824
916
|
context 'realignment of resource with an inline single line hash' do
|
825
|
-
let(:code)
|
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
|
-
|
917
|
+
let(:code) do
|
918
|
+
<<-END.gsub(%r{^ {10}}, '')
|
919
|
+
class { 'puppetdb':
|
920
|
+
database => 'embedded',
|
921
|
+
#database => 'postgres',
|
922
|
+
#postgres_version => '9.3',
|
923
|
+
java_args => { '-Xmx' => '512m', '-Xms' => '256m' },
|
924
|
+
listen_address => $::ipaddress_eth0,
|
925
|
+
listen_port => 4998,
|
926
|
+
ssl_listen_address => $::ipaddress_eth0,
|
927
|
+
ssl_listen_port => 4999,
|
928
|
+
open_listen_port => false,
|
929
|
+
open_ssl_listen_port => false;
|
930
|
+
}
|
931
|
+
END
|
932
|
+
end
|
933
|
+
|
934
|
+
let(:fixed) do
|
935
|
+
<<-END.gsub(%r{^ {10}}, '')
|
936
|
+
class { 'puppetdb':
|
937
|
+
database => 'embedded',
|
938
|
+
#database => 'postgres',
|
939
|
+
#postgres_version => '9.3',
|
940
|
+
java_args => { '-Xmx' => '512m', '-Xms' => '256m' },
|
941
|
+
listen_address => $::ipaddress_eth0,
|
942
|
+
listen_port => 4998,
|
943
|
+
ssl_listen_address => $::ipaddress_eth0,
|
944
|
+
ssl_listen_port => 4999,
|
945
|
+
open_listen_port => false,
|
946
|
+
open_ssl_listen_port => false;
|
947
|
+
}
|
948
|
+
END
|
949
|
+
end
|
856
950
|
|
857
951
|
it 'should detect 8 problems' do
|
858
952
|
expect(problems).to have(8).problems
|
859
953
|
end
|
860
954
|
|
861
955
|
it 'should fix 8 problems' do
|
862
|
-
expect(problems).to contain_fixed(
|
863
|
-
expect(problems).to contain_fixed(
|
864
|
-
expect(problems).to contain_fixed(
|
865
|
-
expect(problems).to contain_fixed(
|
866
|
-
expect(problems).to contain_fixed(
|
867
|
-
expect(problems).to contain_fixed(
|
868
|
-
expect(problems).to contain_fixed(
|
869
|
-
expect(problems).to contain_fixed(
|
956
|
+
expect(problems).to contain_fixed(format(msg, 24, 27)).on_line(2).in_column(27)
|
957
|
+
expect(problems).to contain_fixed(format(msg, 24, 27)).on_line(5).in_column(27)
|
958
|
+
expect(problems).to contain_fixed(format(msg, 24, 27)).on_line(6).in_column(27)
|
959
|
+
expect(problems).to contain_fixed(format(msg, 24, 27)).on_line(7).in_column(27)
|
960
|
+
expect(problems).to contain_fixed(format(msg, 24, 27)).on_line(8).in_column(27)
|
961
|
+
expect(problems).to contain_fixed(format(msg, 24, 27)).on_line(9).in_column(27)
|
962
|
+
expect(problems).to contain_fixed(format(msg, 24, 27)).on_line(10).in_column(27)
|
963
|
+
expect(problems).to contain_fixed(format(msg, 24, 27)).on_line(11).in_column(27)
|
870
964
|
end
|
871
965
|
|
872
966
|
it 'should realign the arrows' do
|