summaryrefslogtreecommitdiffstats
path: root/test/util
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-11-26 09:55:04 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-11-26 09:55:04 +0000
commitccd7b581bf990df618d410441c1f8d349aa225d9 (patch)
tree768e134483b5ed8f82adc69eebba7e8a7146b55e /test/util
parentc301b1b8f7fb417cf61b6ad4975eaa3714100306 (diff)
downloadpuppet-ccd7b581bf990df618d410441c1f8d349aa225d9.tar.gz
puppet-ccd7b581bf990df618d410441c1f8d349aa225d9.tar.xz
puppet-ccd7b581bf990df618d410441c1f8d349aa225d9.zip
Intermediate commit -- I am ready to start pushing the graph stuff into the types and transactions, which will break everything for a little while.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1894 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test/util')
-rwxr-xr-xtest/util/graph.rb34
1 files changed, 4 insertions, 30 deletions
diff --git a/test/util/graph.rb b/test/util/graph.rb
index 0a331f0e9..1df294c77 100755
--- a/test/util/graph.rb
+++ b/test/util/graph.rb
@@ -6,32 +6,12 @@
$:.unshift("../lib").unshift("../../lib") if __FILE__ =~ /\.rb$/
require 'puppettest'
+require 'puppettest/graph'
require 'puppet/util/graph'
class TestUtilGraph < Test::Unit::TestCase
include PuppetTest
-
- 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
+ include PuppetTest::Graph
def test_to_graph
children = %w{a b c d}
@@ -54,13 +34,7 @@ class TestUtilGraph < Test::Unit::TestCase
end
def test_recursive_to_graph
- one = Container.new("one", %w{a b})
-
- two = Container.new("two", ["c", "d"])
-
- middle = Container.new("middle", ["e", "f", two])
-
- top = Container.new("top", ["g", "h", middle, one])
+ one, two, middle, top = build_tree
graph = nil
assert_nothing_raised do
@@ -77,7 +51,7 @@ class TestUtilGraph < Test::Unit::TestCase
end
end
- top.to_jpg(graph)
+ graph.to_jpg("graph")
# Now make sure we correctly retrieve the leaves from each container
{top => %w{a b c d e f g h},