diff options
author | Luke Kanies <luke@madstop.com> | 2007-11-19 01:36:48 -0600 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2007-11-19 01:36:48 -0600 |
commit | 2b14f627aca1d5be69cf6606044df4d6e67f6eba (patch) | |
tree | a20db3a608af483f598f482e743868413da8fd8f /spec/unit/node | |
parent | 9cf477b6cc771eab7bd29d18c49128571e877987 (diff) | |
download | puppet-2b14f627aca1d5be69cf6606044df4d6e67f6eba.tar.gz puppet-2b14f627aca1d5be69cf6606044df4d6e67f6eba.tar.xz puppet-2b14f627aca1d5be69cf6606044df4d6e67f6eba.zip |
Reverting the changes I'd made toward removing the global
resources. These are commits:
c19835ce9f8a5138b30a1a32ca741c996b0916d2
9290cc89a2206fb5204578f8e91208857a48b147
ffb4c2dbc7314b364d25e4f7be599ef05b767b44
Diffstat (limited to 'spec/unit/node')
-rwxr-xr-x | spec/unit/node/configuration.rb | 41 |
1 files changed, 11 insertions, 30 deletions
diff --git a/spec/unit/node/configuration.rb b/spec/unit/node/configuration.rb index 44b98dddb..5780d4fbb 100755 --- a/spec/unit/node/configuration.rb +++ b/spec/unit/node/configuration.rb @@ -301,9 +301,9 @@ end describe Puppet::Node::Configuration, " when functioning as a resource container" do before do @config = Puppet::Node::Configuration.new("host") - @one = stub 'resource1', :ref => "Me[one]", :configuration= => nil, :title => "one", :name => "one" - @two = stub 'resource2', :ref => "Me[two]", :configuration= => nil, :title => "two", :name => "two" - @dupe = stub 'resource3', :ref => "Me[one]", :configuration= => nil, :title => "one", :name => "one" + @one = stub 'resource1', :ref => "Me[one]", :configuration= => nil + @two = stub 'resource2', :ref => "Me[two]", :configuration= => nil + @dupe = stub 'resource3', :ref => "Me[one]", :configuration= => nil end it "should provide a method to add one or more resources" do @@ -412,25 +412,6 @@ describe Puppet::Node::Configuration, " when functioning as a resource container @config.remove_resource(@one) @config.resource("me", "other").should be_nil end - - it "should alias resources whose names are not equal to their titles" do - resource = stub("resource", :name => "one", :title => "two", :ref => "Me[two]", :configuration= => nil) - @config.expects(:alias).with(resource, "one") - @config.add_resource resource - end - - it "should fail to add resources whose names conflict with an existing resource even when the title does not conflict" do - conflict = stub("resource", :name => "one", :ref => "Me[one]", :configuration= => nil) - resource = stub("resource", :name => "one", :title => "other", :ref => "Me[other]", :configuration= => nil) - @config.expects(:alias).with(resource, "one") - @config.add_resource resource - end - - it "should not alias components whose names do not match their titles" do - comp = Puppet::Type::Component.create :name => "one", :title => "two" - @config.expects(:alias).never - @config.add_resource comp - end end module ApplyingConfigurations @@ -557,18 +538,18 @@ end describe Puppet::Node::Configuration, " when creating a relationship graph" do before do @config = Puppet::Node::Configuration.new("host") - @compone = @config.create_resource :component, :name => "one" - @comptwo = @config.create_resource :component, :name => "two", :require => ["class", "one"] - + @compone = Puppet::Type::Component.create :name => "one" + @comptwo = Puppet::Type::Component.create :name => "two", :require => ["class", "one"] @file = Puppet::Type.type(:file) - @one = @config.create_resource :file, :path => "/one" - @two = @config.create_resource :file, :path => "/two" + @one = @file.create :path => "/one" + @two = @file.create :path => "/two" @config.add_edge! @compone, @one @config.add_edge! @comptwo, @two - @three = @config.create_resource :file, :path => "/three" - @four = @config.create_resource :file, :path => "/four", :require => ["file", "/three"] - @five = @config.create_resource :file, :path => "/five" + @three = @file.create :path => "/three" + @four = @file.create :path => "/four", :require => ["file", "/three"] + @five = @file.create :path => "/five" + @config.add_resource @compone, @comptwo, @one, @two, @three, @four, @five @relationships = @config.relationship_graph end |