Skip to content

Commit

Permalink
Merge pull request #142 from Lightpower/master
Browse files Browse the repository at this point in the history
List of labels for Node
  • Loading branch information
maxdemarzi committed Feb 1, 2014
2 parents f1e172e + 8ee5de4 commit 72c3224
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--colour
6 changes: 6 additions & 0 deletions lib/neography/node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,11 @@ def exist?
end
end

##
# List of labels of current node.
# Returns array of strings
def labels
self.neo_server.get_node_labels(self.neo_id)
end
end
end
11 changes: 10 additions & 1 deletion spec/integration/node_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -247,5 +247,14 @@
end
end


describe 'gets labels' do
let(:subject) {
node = Neography::Node.create
node.neo_server.add_label(node, 'Label')
node.neo_server.add_label(node, 'Label2')
node
}

it { subject.labels.should == %w(Label Label2) }
end
end

0 comments on commit 72c3224

Please sign in to comment.