summaryrefslogtreecommitdiffstats
path: root/spec/unit/node
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2007-09-20 12:57:57 -0500
committerLuke Kanies <luke@madstop.com>2007-09-20 12:57:57 -0500
commit46d69068fa7b2f3448294c5d3da21c69cef73d2f (patch)
tree8abf532af73d4fd7d68d894db639004e331318bc /spec/unit/node
parent9fa2628a844c75b8f554f283dfece01667f20594 (diff)
downloadpuppet-46d69068fa7b2f3448294c5d3da21c69cef73d2f.tar.gz
puppet-46d69068fa7b2f3448294c5d3da21c69cef73d2f.tar.xz
puppet-46d69068fa7b2f3448294c5d3da21c69cef73d2f.zip
An intermediate commit so I can start working on a different
branch. The file recursion code actually works for the first time in a painful while, but there are still some quirks and design issues to resolve, particularly around creating implicit resources that then fail (i.e., the behaviour of the create_implicit_resource method in Configuration).
Diffstat (limited to 'spec/unit/node')
-rwxr-xr-xspec/unit/node/configuration.rb19
1 files changed, 15 insertions, 4 deletions
diff --git a/spec/unit/node/configuration.rb b/spec/unit/node/configuration.rb
index ecf311948..eb4eaa418 100755
--- a/spec/unit/node/configuration.rb
+++ b/spec/unit/node/configuration.rb
@@ -334,22 +334,28 @@ describe Puppet::Node::Configuration, " when creating a relationship graph" do
@three = @file.create :path => "/three"
@four = @file.create :path => "/four", :require => ["file", "/three"]
- @config.add_resource @compone, @comptwo, @one, @two, @three, @four
+ @five = @file.create :path => "/five"
+ @config.add_resource @compone, @comptwo, @one, @two, @three, @four, @five
@relationships = @config.relationship_graph
end
- it "should be able to create a resource graph" do
+ it "should be able to create a relationship graph" do
@relationships.should be_instance_of(Puppet::Node::Configuration)
end
+ it "should copy its host_config setting to the relationship graph" do
+ config = Puppet::Node::Configuration.new
+ config.host_config = true
+ config.relationship_graph.host_config.should be_true
+ end
+
it "should not have any components" do
@relationships.vertices.find { |r| r.instance_of?(Puppet::Type::Component) }.should be_nil
end
it "should have all non-component resources from the configuration" do
# The failures print out too much info, so i just do a class comparison
- @relationships.resource(@one.ref).should be_instance_of(@one.class)
- @relationships.resource(@three.ref).should be_instance_of(@three.class)
+ @relationships.vertex?(@five).should be_true
end
it "should have all resource relationships set as edges" do
@@ -412,6 +418,11 @@ describe Puppet::Node::Configuration, " when creating a relationship graph" do
@config.resource("File[/yay]").should be_nil
end
+ it "should remove resources from the relationship graph if it exists" do
+ @config.remove_resource(@one)
+ @config.relationship_graph.vertex?(@one).should be_false
+ end
+
after do
Puppet::Type.allclear
end