diff options
| -rw-r--r-- | lib/puppet/simple_graph.rb | 4 | ||||
| -rwxr-xr-x | spec/unit/simple_graph.rb | 12 |
2 files changed, 9 insertions, 7 deletions
diff --git a/lib/puppet/simple_graph.rb b/lib/puppet/simple_graph.rb index 48bf4991e..c9920e60a 100644 --- a/lib/puppet/simple_graph.rb +++ b/lib/puppet/simple_graph.rb @@ -212,7 +212,7 @@ class Puppet::SimpleGraph params = {'name' => '"'+name+'"', 'fontsize' => fontsize, 'label' => name} - v_label = vertex_label(v) + v_label = v.to_s params.merge!(v_label) if v_label and v_label.kind_of? Hash graph << DOT::DOTNode.new(params) end @@ -220,7 +220,7 @@ class Puppet::SimpleGraph params = {'from' => '"'+ e.source.to_s + '"', 'to' => '"'+ e.target.to_s + '"', 'fontsize' => fontsize } - e_label = edge_label(e) + e_label = e.to_s params.merge!(e_label) if e_label and e_label.kind_of? Hash graph << edge_klass.new(params) end diff --git a/spec/unit/simple_graph.rb b/spec/unit/simple_graph.rb index b9d939867..88873663c 100755 --- a/spec/unit/simple_graph.rb +++ b/spec/unit/simple_graph.rb @@ -23,6 +23,13 @@ describe Puppet::SimpleGraph do @graph.add_edge!(:one, :two) @graph.reversal.edge?(:two, :one).should be_true end + + it "should be able to produce a dot graph" do + @graph = Puppet::SimpleGraph.new + @graph.add_edge!(:one, :two) + + proc { @graph.to_dot_graph }.should_not raise_error + end end describe Puppet::SimpleGraph, " when managing vertices" do @@ -220,8 +227,3 @@ describe Puppet::SimpleGraph, " when reversing graphs" do edge.label.should == {:stuff => :awesome} end end - -describe Puppet::SimpleGraph, " when making DOT files" do - # LAK:FIXME yay - it "should have tests" -end |
