From 0ef6b9579df65adda51389a2ab3e514ef42afa14 Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Tue, 27 Nov 2007 17:24:13 -0600 Subject: 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. --- spec/unit/node/configuration.rb | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'spec/unit/node') 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) -- cgit