From b234e7f1b3029226da8f6e57b6237ddd324d7912 Mon Sep 17 00:00:00 2001 From: Max De Marzi Date: Wed, 23 Jan 2013 23:40:15 -0600 Subject: [PATCH] fixes #69 --- lib/neography/node_traverser.rb | 2 +- spec/integration/node_relationship_spec.rb | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/neography/node_traverser.rb b/lib/neography/node_traverser.rb index 18b1d46..9ef9b7a 100644 --- a/lib/neography/node_traverser.rb +++ b/lib/neography/node_traverser.rb @@ -121,7 +121,7 @@ def iterator options["depth"] = @depth unless @depth.nil? if @relationships[0]["type"].empty? - rels = @from.neo_server.get_node_relationships(@from, @relationships[0]["direction"]) + rels = @from.neo_server.get_node_relationships(@from, @relationships[0]["direction"]) || [] case @relationships[0]["direction"] when "in" rels.collect { |r| @from.neo_server.get_node(r["start"]) } #.uniq diff --git a/spec/integration/node_relationship_spec.rb b/spec/integration/node_relationship_spec.rb index f410d2c..3fef3b1 100644 --- a/spec/integration/node_relationship_spec.rb +++ b/spec/integration/node_relationship_spec.rb @@ -157,6 +157,11 @@ def create_nodes b.outgoing.should include(c) end + it "#both returns an empty array for unconnected nodes" do + a = Neography::Node.create + a.both.size.should == 0 + end + it "#both(type) should return both incoming and outgoing nodes of the given type of depth one" do a,b,c,d,e,f = create_nodes