diff options
| author | Luke Kanies <luke@madstop.com> | 2008-02-28 14:44:39 -0600 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2008-02-28 14:44:39 -0600 |
| commit | fe1f4f57bf5ee0792ee645ec8e0bfddf455ea1e3 (patch) | |
| tree | ad62c32acd6fa7fb22a7025866d43eaea688f673 /spec/unit/node/catalog.rb | |
| parent | dd17d4ca71e17deba8cf19e376e2d711fa516d92 (diff) | |
| parent | c0b5352851d3fdef20b2a432f6f06d31fdc9ce99 (diff) | |
| download | puppet-fe1f4f57bf5ee0792ee645ec8e0bfddf455ea1e3.tar.gz puppet-fe1f4f57bf5ee0792ee645ec8e0bfddf455ea1e3.tar.xz puppet-fe1f4f57bf5ee0792ee645ec8e0bfddf455ea1e3.zip | |
Merge branch '0.24.x' of ssh://reductivelabs.com/opt/rl/git/puppet into 0.24.x
Diffstat (limited to 'spec/unit/node/catalog.rb')
| -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 |
