From 89e8745e8c5c69775f8e1f680dceb39ba7a985ee Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Mon, 17 May 2010 12:22:31 -0700 Subject: Fixing #2655 - Adding default parameter values to resources We were previously just adding these values as variables in the local scope, but we now add them to the resources so they get passed to the client in the catalog and are thus inspectable. Signed-off-by: Luke Kanies --- spec/unit/resource/type.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'spec') diff --git a/spec/unit/resource/type.rb b/spec/unit/resource/type.rb index 27c53936d..cd1881f8c 100755 --- a/spec/unit/resource/type.rb +++ b/spec/unit/resource/type.rb @@ -290,6 +290,14 @@ describe Puppet::Resource::Type do @scope.lookupvar("foo").should == "something" end + it "should set all default values as parameters in the resource" do + @type.set_arguments :foo => stub("value", :safeevaluate => "something") + + @type.set_resource_parameters(@resource, @scope) + + @resource[:foo].should == "something" + end + it "should fail if the resource does not provide a value for a required argument" do @type.set_arguments :foo => nil @resource.expects(:to_hash).returns({}) -- cgit