From dfe774f55e98db085d8f5729a4b1229513c6c2b0 Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Thu, 8 Nov 2007 12:18:42 -0600 Subject: Switching the base class for the Relationship class. It was previously using the GRATR::Edge class, which had wonky overrides that dramatically slowed down sorting (its hash mechanism hashed the source and target so that edges with the same source/target got the same hash, which we actually don't want any more). This shouldn't change any functionality, just performance. I didn't retain all functionality from the Edge class, but a lot of that functionality was, um, horrible, like Edge[] being equivalent to Edge.new. --- spec/unit/other/pgraph.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'spec/unit/other') diff --git a/spec/unit/other/pgraph.rb b/spec/unit/other/pgraph.rb index 9446a8371..41835ebc7 100755 --- a/spec/unit/other/pgraph.rb +++ b/spec/unit/other/pgraph.rb @@ -50,8 +50,8 @@ describe Puppet::PGraph, " when matching edges" do @none = Puppet::Event.new(:source => "a", :event => :NONE) @edges = {} - @edges["a/b"] = Puppet::Relationship["a", "b", {:event => :yay, :callback => :refresh}] - @edges["a/c"] = Puppet::Relationship["a", "c", {:event => :yay, :callback => :refresh}] + @edges["a/b"] = Puppet::Relationship.new("a", "b", {:event => :yay, :callback => :refresh}) + @edges["a/c"] = Puppet::Relationship.new("a", "c", {:event => :yay, :callback => :refresh}) @graph.add_edge!(@edges["a/b"]) end @@ -65,7 +65,9 @@ describe Puppet::PGraph, " when matching edges" do it "should match multiple edges" do @graph.add_edge!(@edges["a/c"]) - @graph.matching_edges([@event]).sort.should == [@edges["a/b"], @edges["a/c"]].sort + edges = @graph.matching_edges([@event]) + edges.should be_include(@edges["a/b"]) + edges.should be_include(@edges["a/c"]) end end -- cgit