Skip to content

Commit

Permalink
using 1.5 GA for install, found problem with gremlin (see rest_gremli…
Browse files Browse the repository at this point in the history
…n_fail_spec.rb)
  • Loading branch information
maxdemarzi committed Nov 10, 2011
1 parent 7596066 commit d9f460a
Show file tree
Hide file tree
Showing 7 changed files with 123 additions and 75 deletions.
4 changes: 2 additions & 2 deletions lib/neography/index.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module Neography
module Index

def index
def index(*args)

end

def find
def find(*args)

end

Expand Down
2 changes: 1 addition & 1 deletion lib/neography/node.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Neography
class Node < PropertyContainer
include Neography::Index
extend Neography::Index
include Neography::NodeRelationship
include Neography::NodePath
include Neography::Equal
Expand Down
3 changes: 2 additions & 1 deletion lib/neography/relationship.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ module Neography
class Relationship < PropertyContainer
include Neography::Equal
include Neography::Property

extend Neography::Index

attr_accessor :start_node, :end_node, :rel_type

class << self
Expand Down
12 changes: 6 additions & 6 deletions lib/neography/tasks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
unless File.exist?('neo4j.zip')
df = File.open('neo4j.zip', 'wb')
begin
df << HTTParty.get("http://dist.neo4j.org/neo4j-community-1.5.M02-windows.zip")
df << HTTParty.get("http://dist.neo4j.org/neo4j-community-1.5-windows.zip")
ensure
df.close()
end
Expand All @@ -30,7 +30,7 @@
end
end
end
FileUtils.mv "neo4j-community-1.5.M02", "neo4j"
FileUtils.mv "neo4j-community-1.5", "neo4j"
end

# Install if running with Admin Privileges
Expand All @@ -40,10 +40,10 @@
end

else
%x[wget http://dist.neo4j.org/neo4j-community-1.5.M02-unix.tar.gz]
%x[tar -xvzf neo4j-community-1.5.M02-unix.tar.gz]
%x[mv neo4j-community-1.5.M02 neo4j]
%x[rm neo4j-community-1.5.M02-unix.tar.gz]
%x[wget http://dist.neo4j.org/neo4j-community-1.5-unix.tar.gz]
%x[tar -xvzf neo4j-community-1.5-unix.tar.gz]
%x[mv neo4j-community-1.5 neo4j]
%x[rm neo4j-community-1.5-unix.tar.gz]
puts "Neo4j Installed in to neo4j directory."
end
puts "Type 'rake neo4j:start' to start it"
Expand Down
1 change: 1 addition & 0 deletions spec/integration/index_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

describe Neography::Relationship, "find" do
before(:each) do
pending "Phase 2 - Index part is not done."
Neography::Relationship.index(:strength)
end

Expand Down
46 changes: 46 additions & 0 deletions spec/integration/rest_gremlin_fail_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
require File.join(File.dirname(__FILE__), '..', 'spec_helper')

describe Neography::Rest do
before(:each) do
@neo = Neography::Rest.new
end

describe "don't break gremlin" do
it "can handle node and relationship indexes" do
new_node1 = @neo.create_node
new_node2 = @neo.create_node
new_relationship = @neo.create_relationship("friends", new_node1, new_node2)
key = generate_text(6)
value = generate_text
@neo.add_node_to_index("test_index", key, value, new_node1)
@neo.add_relationship_to_index("test_index2", key, value, new_relationship)
end

it "gremlin works" do
root_node = @neo.execute_script("g.v(0)")
root_node.should have_key("self")
root_node["self"].split('/').last.should == "0"
end
end


describe "break gremlin" do
it "can can't handle node and relationship indexes with the same name" do
new_node1 = @neo.create_node
new_node2 = @neo.create_node
new_relationship = @neo.create_relationship("friends", new_node1, new_node2)
key = generate_text(6)
value = generate_text
@neo.add_node_to_index("test_index3", key, value, new_node1)
@neo.add_relationship_to_index("test_index3", key, value, new_relationship)
end

it "gremlin works" do
root_node = @neo.execute_script("g.v(0)")
root_node.should have_key("self")
root_node["self"].split('/').last.should == "0"
end
end


end
Loading

0 comments on commit d9f460a

Please sign in to comment.