-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2015a05
commit ab853ae
Showing
3 changed files
with
58 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,9 +57,14 @@ A thin ruby wrapper Neography::Rest which tries to mirror the Neo4j Rest API and | |
:log_enabled => false, | ||
:max_threads => 20}) | ||
|
||
Quick initializer (assumes basic authorization if username is given): | ||
|
||
@neo = Neography::Rest.new("http://username:[email protected]:7474/mydirectory") | ||
|
||
|
||
To Use: | ||
|
||
@neo = Neography::Rest.new | ||
@neo = Neography::Rest.new # Inialize using all default parameters | ||
|
||
@neo.get_root # Get the root node | ||
node1 = @neo.create_node # Create an empty node | ||
|
@@ -138,7 +143,7 @@ Experimental: | |
another_node = @neo.create_node("age" => 31, "name" => "Max") | ||
nodes = @neo.get_nodes([one_set_nodes, another_node]) # Get four nodes | ||
|
||
=== Phase 2 (work in progress): | ||
=== Phase 2 | ||
|
||
Trying to mimic the Neo4j.rb API. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,48 @@ | ||
require File.join(File.dirname(__FILE__), '..', 'spec_helper') | ||
|
||
describe Neography::Rest do | ||
before(:each) do | ||
@neo = Neography::Rest.new({:server => '4c36b641.neo4j.atns.de', :port => 7474, :directory => '/9dc1fda5be8b5cde29621e21cae5adece3de0f37', :authentication => 'basic', :username => "abbe3c012", :password => "34d7b22eb"}) | ||
end | ||
describe "basic authentication" do | ||
describe "get_root" do | ||
it "can get the root node" do | ||
@neo = Neography::Rest.new({:server => '4c36b641.neo4j.atns.de', :port => 7474, :directory => '/9dc1fda5be8b5cde29621e21cae5adece3de0f37', :authentication => 'basic', :username => "abbe3c012", :password => "34d7b22eb"}) | ||
root_node = @neo.get_root | ||
root_node.should have_key("reference_node") | ||
end | ||
end | ||
|
||
describe "create_node" do | ||
it "can create an empty node" do | ||
@neo = Neography::Rest.new({:server => '4c36b641.neo4j.atns.de', :port => 7474, :directory => '/9dc1fda5be8b5cde29621e21cae5adece3de0f37', :authentication => 'basic', :username => "abbe3c012", :password => "34d7b22eb"}) | ||
new_node = @neo.create_node | ||
new_node.should_not be_nil | ||
end | ||
end | ||
|
||
describe "get_root" do | ||
it "can get the root node" do | ||
root_node = @neo.get_root | ||
root_node.should have_key("reference_node") | ||
describe "quick initalizer" do | ||
it "can get the root node" do | ||
@neo = Neography::Rest.new("http://abbe3c012:[email protected]:7474/9dc1fda5be8b5cde29621e21cae5adece3de0f37") | ||
root_node = @neo.get_root | ||
root_node.should have_key("reference_node") | ||
end | ||
end | ||
end | ||
|
||
describe "create_node" do | ||
it "can create an empty node" do | ||
new_node = @neo.create_node | ||
new_node.should_not be_nil | ||
describe "digest authentication" do | ||
describe "get_root" do | ||
it "can get the root node" do | ||
@neo = Neography::Rest.new({:server => '4c36b641.neo4j.atns.de', :port => 7474, :directory => '/9dc1fda5be8b5cde29621e21cae5adece3de0f37', :authentication => 'digest', :username => "abbe3c012", :password => "34d7b22eb"}) | ||
root_node = @neo.get_root | ||
root_node.should have_key("reference_node") | ||
end | ||
end | ||
|
||
describe "create_node" do | ||
it "can create an empty node" do | ||
@neo = Neography::Rest.new({:server => '4c36b641.neo4j.atns.de', :port => 7474, :directory => '/9dc1fda5be8b5cde29621e21cae5adece3de0f37', :authentication => 'digest', :username => "abbe3c012", :password => "34d7b22eb"}) | ||
new_node = @neo.create_node | ||
new_node.should_not be_nil | ||
end | ||
end | ||
end | ||
|
||
end |