diff options
author | Luke Kanies <luke@madstop.com> | 2008-01-14 09:30:30 -0800 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2008-01-14 09:30:30 -0800 |
commit | 488c43771aea482e0212b605bde054bf8cb0533c (patch) | |
tree | 9be9df23afa85c49e3639871ac07abc4db36edc6 /spec/unit/node | |
parent | 5bef4a55b3489a6404ee34b900621af8b784749a (diff) | |
download | puppet-488c43771aea482e0212b605bde054bf8cb0533c.tar.gz puppet-488c43771aea482e0212b605bde054bf8cb0533c.tar.xz puppet-488c43771aea482e0212b605bde054bf8cb0533c.zip |
Fixing automatic relationships. I was previously looking them
up in the relationship graph, which only stores the vertices, not
the resource table.
Diffstat (limited to 'spec/unit/node')
-rwxr-xr-x | spec/unit/node/catalog.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/unit/node/catalog.rb b/spec/unit/node/catalog.rb index 6f246f6b3..4f9613d00 100755 --- a/spec/unit/node/catalog.rb +++ b/spec/unit/node/catalog.rb @@ -618,13 +618,17 @@ describe Puppet::Node::Catalog, " when creating a relationship graph" do @file = Puppet::Type.type(:file) @one = @file.create :path => "/one" @two = @file.create :path => "/two" + @sub = @file.create :path => "/two/three" + + @sub.stubs(:autorequire).returns([Puppet::Relationship.new(@two, @sub)]) + @catalog.add_edge! @compone, @one @catalog.add_edge! @comptwo, @two @three = @file.create :path => "/three" @four = @file.create :path => "/four", :require => ["file", "/three"] @five = @file.create :path => "/five" - @catalog.add_resource @compone, @comptwo, @one, @two, @three, @four, @five + @catalog.add_resource @compone, @comptwo, @one, @two, @three, @four, @five, @sub @relationships = @catalog.relationship_graph end @@ -659,6 +663,10 @@ describe Puppet::Node::Catalog, " when creating a relationship graph" do @relationships.edge?(@one, @two).should be_true end + it "should add automatic relationships to the relationship graph" do + @relationships.edge?(@two, @sub).should be_true + end + it "should get removed when the catalog is cleaned up" do @relationships.expects(:clear).with(false) @catalog.clear |