summaryrefslogtreecommitdiffstats
path: root/spec/unit/other
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2007-11-08 12:18:42 -0600
committerLuke Kanies <luke@madstop.com>2007-11-08 12:18:42 -0600
commitdfe774f55e98db085d8f5729a4b1229513c6c2b0 (patch)
tree39915f08eff31c0d6f690e05b7ebb3f594338536 /spec/unit/other
parentf465e7e96d62f9b18bdebd51319582d5b2ffa332 (diff)
downloadpuppet-dfe774f55e98db085d8f5729a4b1229513c6c2b0.tar.gz
puppet-dfe774f55e98db085d8f5729a4b1229513c6c2b0.tar.xz
puppet-dfe774f55e98db085d8f5729a4b1229513c6c2b0.zip
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.
Diffstat (limited to 'spec/unit/other')
-rwxr-xr-xspec/unit/other/pgraph.rb8
1 files changed, 5 insertions, 3 deletions
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