puppet-lint-class_parameter-check 0.1.1 → 0.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8d4ff8ab903779758a54fac337183a597a64ecf2
4
- data.tar.gz: 13672cb4c1c29d1f461b8c573bff36b172bcbd3c
3
+ metadata.gz: 65efc25251eee8bc2c28d16e5be4435afb9521bc
4
+ data.tar.gz: 349993e2be2bd016e7e16ead67aa00923a8dfd81
5
5
  SHA512:
6
- metadata.gz: fe4e9065152745426c4f8ad70c9c8b0606ed9612313e862e9294eea4a7b7a89ce6ee402d58e23c7829e205d5c22653652be3ad2d54c0475ebb3e572f134aa171
7
- data.tar.gz: 52fa35443e2dee2370ec19c32f7121543df9923abc4904cfa321548b468faf4d51e1d427bb021aa942d33f0d28d168bc9c7721c0426ca277e81038ae95a2d15e
6
+ metadata.gz: 50eb750c17c5fced42427db76308f7e49e1d8bcce528cf4eb2f19172e5a5d6ae4ceb8dc2f5001a97a5bad26ed3a21cdea697690d82107e7876df0bc6580dfadd
7
+ data.tar.gz: 5cb5e02c7bce3fe07b0472a89497c58002bfa8bca9a0e3b1fb2e8c608e6f66f3a9c61ed2cdf9e372882573974b05ca820eea9a9cee7e56d76f619969516c174f
@@ -48,9 +48,9 @@ class ClassParameterList
48
48
  stack = []
49
49
 
50
50
  @tokens.inject([]) do |memo, token|
51
- if token.type == :LBRACK
51
+ if token.type == :LBRACK || token.type == :LPAREN
52
52
  stack.push(true)
53
- elsif token.type == :RBRACK
53
+ elsif token.type == :RBRACK || token.type == :RPAREN
54
54
  stack.pop
55
55
  end
56
56
 
@@ -39,7 +39,6 @@ describe 'class_parameter' do
39
39
  it 'has no problems' do
40
40
  expect(problems).to have(0).problems
41
41
  end
42
-
43
42
  end
44
43
  end
45
44
 
@@ -82,6 +81,19 @@ describe 'class_parameter' do
82
81
  expect(problems).to have(0).problems
83
82
  end
84
83
  end
84
+
85
+ context 'optional parameter initialized with function' do
86
+ let(:code) { <<-EOF
87
+ class puppet_module(
88
+ Hash [String, String] $users = hiera_hash('some::hieradata::key', {})
89
+ ) { }
90
+ EOF
91
+ }
92
+
93
+ it 'has no problems' do
94
+ expect(problems).to have(0).problems
95
+ end
96
+ end
85
97
  end
86
98
 
87
99
  context 'class with required and optional parameters' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet-lint-class_parameter-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
  - Roelof Reitsma