diff options
| author | Luke Kanies <luke@puppetlabs.com> | 2010-05-17 12:22:31 -0700 |
|---|---|---|
| committer | test branch <puppet-dev@googlegroups.com> | 2010-02-17 06:50:53 -0800 |
| commit | 89e8745e8c5c69775f8e1f680dceb39ba7a985ee (patch) | |
| tree | f754cfb46dc8b4da9ec67c2369dd41f4135d9bc1 /spec | |
| parent | edcf4297628c704787ff2e7310271d9ccc019816 (diff) | |
| download | puppet-89e8745e8c5c69775f8e1f680dceb39ba7a985ee.tar.gz puppet-89e8745e8c5c69775f8e1f680dceb39ba7a985ee.tar.xz puppet-89e8745e8c5c69775f8e1f680dceb39ba7a985ee.zip | |
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 <luke@puppetlabs.com>
Diffstat (limited to 'spec')
| -rwxr-xr-x | spec/unit/resource/type.rb | 8 |
1 files changed, 8 insertions, 0 deletions
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({}) |
