summaryrefslogtreecommitdiffstats
path: root/spec/unit/node
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-06-16 23:41:33 -0500
committerLuke Kanies <luke@madstop.com>2008-06-16 23:46:06 -0500
commit4d9536418d8f684923063eac03d3a59d69bb3794 (patch)
tree1225c14b60e61989eafee80614f40db1af12b868 /spec/unit/node
parent543181272da492755e9219530d17f76a63faffef (diff)
downloadpuppet-4d9536418d8f684923063eac03d3a59d69bb3794.tar.gz
puppet-4d9536418d8f684923063eac03d3a59d69bb3794.tar.xz
puppet-4d9536418d8f684923063eac03d3a59d69bb3794.zip
Fixed #1221 - aliases to titles now work for resources.
Diffstat (limited to 'spec/unit/node')
-rwxr-xr-xspec/unit/node/catalog.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/spec/unit/node/catalog.rb b/spec/unit/node/catalog.rb
index ff9ab6930..b4f1503da 100755
--- a/spec/unit/node/catalog.rb
+++ b/spec/unit/node/catalog.rb
@@ -345,9 +345,9 @@ end
describe Puppet::Node::Catalog, " when functioning as a resource container" do
before do
@catalog = Puppet::Node::Catalog.new("host")
- @one = stub 'resource1', :ref => "Me[one]", :catalog= => nil
- @two = stub 'resource2', :ref => "Me[two]", :catalog= => nil
- @dupe = stub 'resource3', :ref => "Me[one]", :catalog= => nil
+ @one = stub 'resource1', :ref => "Me[one]", :catalog= => nil, :title => "one"
+ @two = stub 'resource2', :ref => "Me[two]", :catalog= => nil, :title => "two"
+ @dupe = stub 'resource3', :ref => "Me[one]", :catalog= => nil, :title => "one"
end
it "should provide a method to add one or more resources" do
@@ -482,6 +482,11 @@ describe Puppet::Node::Catalog, " when functioning as a resource container" do
proc { @catalog.alias @one, "one" }.should_not raise_error
end
+ it "should not create aliases that point back to the resource" do
+ @catalog.alias(@one, "one")
+ @catalog.resource(:me, "one").should be_nil
+ end
+
it "should be able to look resources up by their aliases" do
@catalog.add_resource @one
@catalog.alias @one, "two"