summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-04-12 23:10:58 -0500
committerLuke Kanies <luke@madstop.com>2009-04-12 23:10:58 -0500
commit88ff9c6500e76fdda02e60262dd1571577c0b92b (patch)
tree3ec61f089d2a81da44b4f436fbab31cb68998889 /spec
parent36594fecd8e30f732f09bc940adbb4c686e314ba (diff)
downloadpuppet-88ff9c6500e76fdda02e60262dd1571577c0b92b.tar.gz
puppet-88ff9c6500e76fdda02e60262dd1571577c0b92b.tar.xz
puppet-88ff9c6500e76fdda02e60262dd1571577c0b92b.zip
Fixing #2111 - SimpleGraph only creates valid adjacencies
The way this class was testing edges was causing them to appear adjacencies to appear magically, because it was only testing that a hash had a key, not that the value had any edges. This fixes the infinite recursion mentioned in #2111. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec')
-rwxr-xr-xspec/unit/simple_graph.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/unit/simple_graph.rb b/spec/unit/simple_graph.rb
index 2c061ae1a..a5984c989 100755
--- a/spec/unit/simple_graph.rb
+++ b/spec/unit/simple_graph.rb
@@ -197,6 +197,15 @@ describe Puppet::SimpleGraph do
it "should support returning an array of matching edges" do
@graph.adjacent(:two, :type => :edges).should == [@two_three]
end
+
+ # Bug #2111
+ it "should not consider a vertex adjacent just because it was asked about previously" do
+ @graph = Puppet::SimpleGraph.new
+ @graph.add_vertex("a")
+ @graph.add_vertex("b")
+ @graph.edge?("a", "b")
+ @graph.adjacent("a").should == []
+ end
end
describe "when clearing" do