diff options
Diffstat (limited to 'spec/unit/parser/ast/vardef.rb')
| -rwxr-xr-x | spec/unit/parser/ast/vardef.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/unit/parser/ast/vardef.rb b/spec/unit/parser/ast/vardef.rb index 9730ceedb..a6863e75f 100755 --- a/spec/unit/parser/ast/vardef.rb +++ b/spec/unit/parser/ast/vardef.rb @@ -43,5 +43,18 @@ describe Puppet::Parser::AST::VarDef do vardef.evaluate(@scope) end + describe "when dealing with hash" do + it "should delegate to the HashOrArrayAccess assign" do + access = stub 'name' + access.stubs(:is_a?).with(Puppet::Parser::AST::HashOrArrayAccess).returns(true) + value = stub 'value', :safeevaluate => "1" + vardef = Puppet::Parser::AST::VarDef.new :name => access, :value => value, :file => nil, :line => nil + + access.expects(:assign).with(@scope, '1') + + vardef.evaluate(@scope) + end + end + end end |
