Skip to content

Commit

Permalink
Added spec for getInorderData method of DirectedGraph.java
Browse files Browse the repository at this point in the history
  • Loading branch information
prathamesh-sonpatki committed Dec 5, 2012
1 parent 9deef64 commit 9a3eb79
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions spec/ir/directed_graph/directed_graph_spec.rb
Expand Up @@ -84,4 +84,14 @@
end end
end end


it "should give data in the graph in the order in which it was inserted" do
@graph.getInorderData.to_a.size.should be 0
@graph.vertexFor(1)
@graph.getInorderData.to_a.should eq [1]
@graph.addEdge('foo','bar','baz')
@graph.getInorderData.to_a.should eq [1,'foo','bar']
@graph.removeVertexFor('foo')
@graph.getInorderData.to_a.should eq [1,'bar']
end

end end

0 comments on commit 9a3eb79

Please sign in to comment.