puppet-lint-absolute_classname-check 0.2.2 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NTIwMTUwMWEyZjc0NmFhM2Y3YTFmNDI5ODQ1YzhhYTQ5NWFhNWU4Mg==
4
+ MWFlMTZkOGE3NDQ2YTBhNTEzZmFmMWM2YTRmNTQ1ZjRiOTgzNTUzYw==
5
5
  data.tar.gz: !binary |-
6
- MmU4ZjZiMjlkZjJiNTI2OGUwZDNlYjg5YTk1OTA4YjUyOWQ5YjEzOQ==
6
+ YmM5MDcwNjFhOTNjNmQ3NTczYThkZmRkZTE4Y2IwZTE3Y2IwODczYw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MDZlYjZiZDgxMTljZmNkNTkwYjc2MjUwNWVlNWY2NWZkY2IxNGE0MzYzM2Vj
10
- ZmQ0YjZiZDlhZmRjOGUyMzFhMWFkMzM1ZmMwNDVhMTJhMGZkODEwZGI4NWQ2
11
- MTVhMDc4ODQ5MGY2MDVlZDM3NGEwNTg1N2M3Y2U2NThhMWUzNmQ=
9
+ YmQ0ZDU3MGU4Y2JlY2E5OTZmMzhmNDg0MWE5ZjZmMDVjNGQzMDEzOGJkMTZm
10
+ ZjkxNWZhM2IzY2ZjNzQ3OGNkYjk0ZGUyODUwYjc0YjJhN2I3MDVlZmQ4ZDVh
11
+ MjkxNGFjMTM1MjhjNmUyODdmZmMxZGE5YzM2YTliZjllMjdkNDE=
12
12
  data.tar.gz: !binary |-
13
- YjNhMzBmMzgzMTVmODhiYWVjYmZlYzM4NDFmZjcwNDBkZWQwYTRiNTM2MjJi
14
- YzhjYzk1OTIyMjg1MmJjMjNiOTE0ZGY2ZTI5NTNlNGFhMzkyNzQ4ZmMzNDdh
15
- OTg3MWViMjg5YWU1NThiMzQyMTc4OTZmYjQ1YzJkNTc2NzkxMzQ=
13
+ NzcwMWVmODk1NzE4Y2NlZTQ4ODY0YWFlNTBhZDExZDlkMjA5NWZkYmFkYWI0
14
+ MGQxOWU5NWEzZDA1YTU1Njc2MDk2ZDQ0NGVhZGE4MTZjYzczMTRlOWQzN2Fm
15
+ MmE5MDU5YmFjOTc1MWZhZmJhOTc2NmU0YThhNTAwZDI3OWJhM2Q=
@@ -2,8 +2,8 @@ PuppetLint.new_check(:relative_classname_inclusion) do
2
2
  def check
3
3
  tokens.each_with_index do |token, token_idx|
4
4
  if token.type == :NAME && ['include','contain','require'].include?(token.value)
5
- next if resource_indexes.any? { |resource| resource[:tokens].include?(token) }
6
5
  s = token.next_code_token
6
+ next if s.type == :FARROW
7
7
  in_function = 0
8
8
  while s.type != :NEWLINE
9
9
  n = s.next_code_token
@@ -79,6 +79,23 @@ describe 'relative_classname_inclusion' do
79
79
  expect(problems).to have(0).problems
80
80
  end
81
81
  end
82
+
83
+ context 'when require is a hash key' do
84
+ let(:code) do
85
+ <<-EOS
86
+ $defaults = {
87
+ require => Exec['apt_update'],
88
+ }
89
+ $defaults = {
90
+ 'require' => Exec['apt_update'],
91
+ }
92
+ EOS
93
+ end
94
+
95
+ it 'should detect no problems' do
96
+ expect(problems).to have(0).problems
97
+ end
98
+ end
82
99
  end
83
100
 
84
101
  context 'with fix enabled' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet-lint-absolute_classname-check
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet Community