diff options
| author | Luke Kanies <luke@madstop.com> | 2007-09-20 12:57:57 -0500 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2007-09-20 12:57:57 -0500 |
| commit | 46d69068fa7b2f3448294c5d3da21c69cef73d2f (patch) | |
| tree | 8abf532af73d4fd7d68d894db639004e331318bc /spec/unit | |
| parent | 9fa2628a844c75b8f554f283dfece01667f20594 (diff) | |
| download | puppet-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')
| -rwxr-xr-x | spec/unit/indirector/indirection.rb | 2 | ||||
| -rwxr-xr-x | spec/unit/indirector/indirector.rb | 2 | ||||
| -rwxr-xr-x | spec/unit/node/configuration.rb | 19 | ||||
| -rwxr-xr-x | spec/unit/other/modules.rb | 4 | ||||
| -rwxr-xr-x | spec/unit/util/config.rb | 2 |
5 files changed, 22 insertions, 7 deletions
diff --git a/spec/unit/indirector/indirection.rb b/spec/unit/indirector/indirection.rb index e9b10c8c7..c9f15382e 100755 --- a/spec/unit/indirector/indirection.rb +++ b/spec/unit/indirector/indirection.rb @@ -26,7 +26,7 @@ describe Puppet::Indirector::Indirection, " when initializing" do end end -describe Puppet::Indirector, " when managing termini" do +describe Puppet::Indirector::Indirection, " when managing termini" do before do @indirection = Puppet::Indirector::Indirection.new(:node, :to => :node_source) end diff --git a/spec/unit/indirector/indirector.rb b/spec/unit/indirector/indirector.rb index 312c60951..5453d30a7 100755 --- a/spec/unit/indirector/indirector.rb +++ b/spec/unit/indirector/indirector.rb @@ -11,6 +11,8 @@ describe Puppet::Indirector, " when managing indirections" do @indirector.send(:extend, Puppet::Indirector) end + it "should require a name" + it "should create an indirection" do indirection = @indirector.indirects :test, :to => :node_source indirection.name.should == :test 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 diff --git a/spec/unit/other/modules.rb b/spec/unit/other/modules.rb index 0ab37aa9e..dbd091d9a 100755 --- a/spec/unit/other/modules.rb +++ b/spec/unit/other/modules.rb @@ -5,10 +5,10 @@ require File.dirname(__FILE__) + '/../../spec_helper' describe Puppet::Module, " when building its search path" do include PuppetTest - it "should ignore unqualified paths in the search path" do + it "should fully qualify unqualified paths in the search path" do Puppet[:modulepath] = "something:/my/something" File.stubs(:directory?).returns(true) - Puppet::Module.modulepath.should == %w{/my/something} + Puppet::Module.modulepath.should == [File.join(Dir.getwd, 'something'), "/my/something"] end it "should ignore paths that do not exist" do diff --git a/spec/unit/util/config.rb b/spec/unit/util/config.rb index 353bc2bcb..8114acb8e 100755 --- a/spec/unit/util/config.rb +++ b/spec/unit/util/config.rb @@ -426,6 +426,8 @@ describe Puppet::Util::Config, " when being used to manage the host machine" do pending "Not converted from test/unit yet" end + it "should create files when configured to do so with the :create parameter" + it "should provide a method to convert the file mode enforcement into transportable resources" do # Make it think we're root so it tries to manage user and group. Puppet.features.stubs(:root?).returns(true) |
