Skip to content

Commit

Permalink
fixes #69
Browse files Browse the repository at this point in the history
  • Loading branch information
maxdemarzi committed Jan 24, 2013
1 parent 4884d9c commit b234e7f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/neography/node_traverser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions spec/integration/node_relationship_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit b234e7f

Please sign in to comment.