diff options
| author | Luke Kanies <luke@madstop.com> | 2007-09-12 18:32:26 -0500 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2007-09-12 18:32:26 -0500 |
| commit | 43f22a2414048b180d2c0e2a421fa8d905c4d8eb (patch) | |
| tree | 72eb0cc1ade37f032284c77ca51a7d1e22d5b317 /test/lib | |
| parent | a6fe70054f4fb3efe4d558ffdd244917ca1c6f9c (diff) | |
| download | puppet-43f22a2414048b180d2c0e2a421fa8d905c4d8eb.tar.gz puppet-43f22a2414048b180d2c0e2a421fa8d905c4d8eb.tar.xz puppet-43f22a2414048b180d2c0e2a421fa8d905c4d8eb.zip | |
Adding a to_graph method to TransBuckets, so that the buckets can directly generate a graph, rather than having to first convert to RAL types and then have them convert to a graph. This allows us to make it so components do not need a @children array at all. This was all done because I am having the "already a parent of" problem again, and I have gotten far enough that it is relatively easy to just make this problem go away once and for all.
Diffstat (limited to 'test/lib')
| -rwxr-xr-x | test/lib/puppettest.rb | 1 | ||||
| -rw-r--r-- | test/lib/puppettest/graph.rb | 41 |
2 files changed, 1 insertions, 41 deletions
diff --git a/test/lib/puppettest.rb b/test/lib/puppettest.rb index 06b85f147..33e3b2daf 100755 --- a/test/lib/puppettest.rb +++ b/test/lib/puppettest.rb @@ -265,6 +265,7 @@ module PuppetTest Puppet::Util::Storage.clear Puppet.clear Puppet.config.clear + Puppet::Indirector::Indirection.clear_cache @memoryatend = Puppet::Util.memory diff = @memoryatend - @memoryatstart diff --git a/test/lib/puppettest/graph.rb b/test/lib/puppettest/graph.rb deleted file mode 100644 index db77889bd..000000000 --- a/test/lib/puppettest/graph.rb +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env ruby -# -# Created by Luke A. Kanies on 2006-11-24. -# Copyright (c) 2006. All rights reserved. - -require 'puppet/util/graph' - -class Container - include Puppet::Util::Graph - include Enumerable - attr_accessor :name - def each - @children.each do |c| yield c end - end - - def initialize(name, ary) - @name = name - @children = ary - end - - def push(*ary) - ary.each { |c| @children.push(c)} - end - - def to_s - @name - end -end - -module PuppetTest::Graph - def build_tree - one = Container.new("one", %w{a b}) - two = Container.new("two", ["c", "d"]) - three = Container.new("three", ["i", "j"]) - middle = Container.new("middle", ["e", "f", two]) - top = Container.new("top", ["g", "h", middle, one, three]) - return one, two, three, middle, top - end -end - -# $Id$ |
