diff options
author | Luke Kanies <luke@madstop.com> | 2007-11-27 17:24:13 -0600 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2007-11-27 17:24:13 -0600 |
commit | 0ef6b9579df65adda51389a2ab3e514ef42afa14 (patch) | |
tree | 150340dc12e29d3b8397521e33e2baf60147d299 /spec/unit/node | |
parent | a38b4151244c0af4bdf058d3fec5a01dc271e1c3 (diff) | |
download | puppet-0ef6b9579df65adda51389a2ab3e514ef42afa14.tar.gz puppet-0ef6b9579df65adda51389a2ab3e514ef42afa14.tar.xz puppet-0ef6b9579df65adda51389a2ab3e514ef42afa14.zip |
Fixing #931 by keeping track in configurations of
what transportable resources get converted to, so
different names don't throw it off.
I also got rid of the Puppet::Type#merge method, which
has been deprecated for ages but was still in there. I
had to fix a few tests that weren't cleaning up after themselves
as a result.
Diffstat (limited to 'spec/unit/node')
-rwxr-xr-x | spec/unit/node/configuration.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/unit/node/configuration.rb b/spec/unit/node/configuration.rb index 5780d4fbb..0a8b47fc5 100755 --- a/spec/unit/node/configuration.rb +++ b/spec/unit/node/configuration.rb @@ -292,6 +292,28 @@ describe Puppet::Node::Configuration, " when converting to a RAL configuration" @config.vertices.each { |v| v.configuration.object_id.should equal(@config.object_id) } end + # This tests #931. + it "should not lose track of resources whose names vary" do + changer = Puppet::TransObject.new 'changer', 'test' + + config = Puppet::Node::Configuration.new('test') + config.add_resource(changer) + config.add_resource(@top) + + config.add_edge!(@top, changer) + + resource = stub 'resource', :name => "changer2", :title => "changer2", :ref => "Test[changer2]", :configuration= => nil, :remove => nil + + changer.expects(:to_type).returns(resource) + + newconfig = nil + + Puppet::Type.allclear + + proc { @config = config.to_ral }.should_not raise_error + @config.resource("Test[changer2]").should equal(resource) + end + after do # Remove all resource instances. @config.clear(true) |