diff options
author | Luke Kanies <luke@madstop.com> | 2008-02-25 19:40:44 -0500 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2008-02-25 19:40:44 -0500 |
commit | 125851278d745e443c0598fbb0577b010f824365 (patch) | |
tree | 6b7abbf4e6ce7a2542ceb2a88f8c9ce9b1e860e4 /spec/unit/node | |
parent | 9a3348764b30ad355f14c27b497ae18ed20f9ea8 (diff) | |
download | puppet-125851278d745e443c0598fbb0577b010f824365.tar.gz puppet-125851278d745e443c0598fbb0577b010f824365.tar.xz puppet-125851278d745e443c0598fbb0577b010f824365.zip |
Fixing #1084 -- the node catalog asks the individual
resources whether they're isomorphic, and they in turn
ask the resource types (or default to true for defined
resource types).
Diffstat (limited to 'spec/unit/node')
-rwxr-xr-x | spec/unit/node/catalog.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/spec/unit/node/catalog.rb b/spec/unit/node/catalog.rb index b1bf5abaa..604dabbb6 100755 --- a/spec/unit/node/catalog.rb +++ b/spec/unit/node/catalog.rb @@ -476,17 +476,19 @@ describe Puppet::Node::Catalog, " when functioning as a resource container" do it "should add an alias for the namevar when the title and name differ on isomorphic resource types" do resource = Puppet::Type.type(:file).create :path => "/something", :title => "other", :content => "blah" + resource.expects(:isomorphic?).returns(true) @catalog.add_resource(resource) @catalog.resource(:file, "other").should equal(resource) @catalog.resource(:file, "/something").ref.should == resource.ref end it "should not add an alias for the namevar when the title and name differ on non-isomorphic resource types" do - resource = Puppet::Type.type(:exec).create :command => "/bin/true", :title => "other" + resource = Puppet::Type.type(:file).create :path => "/something", :title => "other", :content => "blah" + resource.expects(:isomorphic?).returns(false) @catalog.add_resource(resource) - @catalog.resource(:exec, resource.title).should equal(resource) + @catalog.resource(:file, resource.title).should equal(resource) # We can't use .should here, because the resources respond to that method. - if @catalog.resource(:exec, resource.name) + if @catalog.resource(:file, resource.name) raise "Aliased non-isomorphic resource" end end |