diff options
author | Brice Figureau <brice-puppet@daysofwonder.com> | 2011-02-12 16:58:20 +0100 |
---|---|---|
committer | Brice Figureau <brice-puppet@daysofwonder.com> | 2011-02-12 16:58:20 +0100 |
commit | c373b6272ddd4daabf15d1b459ef3e86072e3f26 (patch) | |
tree | 3476631e427721dda508f46e672eb666c559a8f9 /spec | |
parent | 70a43c4b0d3018a39e29c50b1caf7dec38694323 (diff) | |
download | puppet-c373b6272ddd4daabf15d1b459ef3e86072e3f26.tar.gz puppet-c373b6272ddd4daabf15d1b459ef3e86072e3f26.tar.xz puppet-c373b6272ddd4daabf15d1b459ef3e86072e3f26.zip |
Fix #6269 - Hashes only work with two levels of access
The following manifest was failing:
$hash = { 'a' => { 'b' => { 'c' => 'it works' } } }
$out = $hash['a']['b']['c']
because of a typo in the grammar.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
Diffstat (limited to 'spec')
-rwxr-xr-x | spec/integration/parser/parser_spec.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/integration/parser/parser_spec.rb b/spec/integration/parser/parser_spec.rb index 7b85bcacb..20d87c228 100755 --- a/spec/integration/parser/parser_spec.rb +++ b/spec/integration/parser/parser_spec.rb @@ -109,5 +109,12 @@ describe Puppet::Parser::Parser do it "should correctly set the arrow type of a relationship" do "Notify[foo] <~ Notify[bar]".should parse_with { |rel| rel.arrow == "<~" } end + + it "should be able to parse deep hash access" do + %q{ + $hash = { 'a' => { 'b' => { 'c' => 'it works' } } } + $out = $hash['a']['b']['c'] + }.should parse_with { |v| v.value.is_a?(Puppet::Parser::AST::ASTHash) } + end end end |