puppet-lint-template_file_extension-check 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ed1fc7b6dbe9b2dada9167beb0fd4031173a3636
4
- data.tar.gz: 50c2a6bf683352e51518834475a13e792cb3e529
3
+ metadata.gz: 9ffba03632899b62706b4ea5f7bd1cf8d0ed4e2a
4
+ data.tar.gz: 77aee2c96d2523b63ac8eb8e059a7e20c205e0f1
5
5
  SHA512:
6
- metadata.gz: 094fa6fb18f119a87be96d7977a1f328705772c8c97d1da39c547ef7ac8f867d74e1dee38372e5f8f76a6399202695acf979f8255f860716af6e8e5959be8b0b
7
- data.tar.gz: 0cbb0f81f7abc8ce8dd5456ad0bc4156dd39da21ef0aa4405e2d5bf1292b4dd0be763cb0b24c0d09411509b3c26044f95e9c8f9122d826539be7287c63bbd2fb
6
+ metadata.gz: 6adcebd70d56572520f5ea4a22c7555c48d1c9d2e29d29a4b7f5e6d02c2fadac11811f6ab6a21b797b29ff6c239d48706f699ca7b6064cabaa0e5760f9cd6839
7
+ data.tar.gz: 2c1d179325475d174ad627fc98b7b78c44a0c0191ee9d92a793e7c30f37e715dd9cfa4b480fb2e3219c63cea51954fec0b032375dd9da10ddda9516c0bfa8b3f
@@ -19,6 +19,7 @@ PuppetLint.new_check(:template_file_extension) do
19
19
  extension = template_extensions[template_function.to_sym]
20
20
 
21
21
  current_token = value_token.next_token
22
+ current_token = current_token.next_token while current_token.type == :WHITESPACE
22
23
 
23
24
  # iterate over all the code tokens until we hit the closing ')'
24
25
  until current_token.type == :RPAREN || current_token.type == :LBRACE
@@ -54,6 +54,22 @@ describe 'template_file_extension' do
54
54
  end
55
55
  end
56
56
 
57
+ context 'space between template and opening paren' do
58
+ let(:code) do
59
+ <<-EOS
60
+ class space_between_template_and_opening_paren {
61
+ file { '/tmp/templated':
62
+ content => template ('mymodule/a_file.erb'),
63
+ }
64
+ }
65
+ EOS
66
+ end
67
+
68
+ it 'should not detect any problems' do
69
+ expect(problems).to have(0).problems
70
+ end
71
+ end
72
+
57
73
  ##########################
58
74
  # Invalid examples
59
75
  ##########################
@@ -102,4 +118,25 @@ describe 'template_file_extension' do
102
118
  end
103
119
  end
104
120
 
121
+ context 'space between template and opening paren and no extension' do
122
+ let(:code) do
123
+ <<-EOS
124
+ class space_between_template_and_opening_paren {
125
+ file { '/tmp/templated':
126
+ content => template ('mymodule/a_file'),
127
+ }
128
+ }
129
+ EOS
130
+ end
131
+
132
+ it 'should detect a single problem' do
133
+ expect(problems).to have(1).problem
134
+ end
135
+
136
+ it 'should create a warning' do
137
+ expect(problems).to contain_warning(template_msg).on_line(3).in_column(26)
138
+ end
139
+ end
140
+
141
+
105
142
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet-lint-template_file_extension-check
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dean Wilson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-14 00:00:00.000000000 Z
11
+ date: 2018-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: puppet-lint
@@ -161,7 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
161
161
  version: '0'
162
162
  requirements: []
163
163
  rubyforge_project:
164
- rubygems_version: 2.5.1
164
+ rubygems_version: 2.6.8
165
165
  signing_key:
166
166
  specification_version: 4
167
167
  summary: puppet-lint template_file_extension check