neo4jrb / neo4jrb_spatial

Basic integration between Neo4j.rb and Neo4j Spatial
12 stars 12 forks source link

More problems with new modern versions of neo4jrb #9

Closed ProGM closed 8 years ago

ProGM commented 8 years ago

I tried to clone the repo, run bundle install and finally run tests:

$ bundle exec rspec
/Users/progm/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/neo4j-7.0.10/lib/neo4j/shared/type_converters.rb:249:in `convert_type': uninitialized constant Class::JSON (NameError)
    from /Users/progm/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/neo4j-7.0.10/lib/neo4j/shared/type_converters.rb:413:in `register_converter'
    from /Users/progm/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/neo4j-7.0.10/lib/neo4j/shared/type_converters.rb:376:in `block in included'
    from /Users/progm/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/neo4j-7.0.10/lib/neo4j/shared/type_converters.rb:374:in `each'
    from /Users/progm/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/neo4j-7.0.10/lib/neo4j/shared/type_converters.rb:374:in `included'
    from /Users/progm/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/neo4j-7.0.10/lib/neo4j/type_converters.rb:5:in `include'
    from /Users/progm/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/neo4j-7.0.10/lib/neo4j/type_converters.rb:5:in `<module:TypeConverters>'
    from /Users/progm/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/neo4j-7.0.10/lib/neo4j/type_converters.rb:2:in `<module:Neo4j>'
    from /Users/progm/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/neo4j-7.0.10/lib/neo4j/type_converters.rb:1:in `<top (required)>'
    from /Users/progm/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/neo4j-7.0.10/lib/neo4j.rb:18:in `require'
    from /Users/progm/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/neo4j-7.0.10/lib/neo4j.rb:18:in `<top (required)>'
    from /Users/progm/lavoro/neo4jrb_spatial/spec/spec_helper.rb:4:in `require'
    from /Users/progm/lavoro/neo4jrb_spatial/spec/spec_helper.rb:4:in `<top (required)>'
    from /Users/progm/lavoro/neo4jrb_spatial/spec/neo4jrb_spatial_spec.rb:1:in `require'
    from /Users/progm/lavoro/neo4jrb_spatial/spec/neo4jrb_spatial_spec.rb:1:in `<top (required)>'
    from /Users/progm/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1361:in `load'
    from /Users/progm/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1361:in `block in load_spec_files'
    from /Users/progm/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1359:in `each'
    from /Users/progm/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1359:in `load_spec_files'
    from /Users/progm/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:106:in `setup'
    from /Users/progm/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:92:in `run'
    from /Users/progm/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:78:in `run'
    from /Users/progm/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.4/lib/rspec/core/runner.rb:45:in `invoke'
    from /Users/progm/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rspec-core-3.4.4/exe/rspec:4:in `<top (required)>'
    from /Users/progm/.rbenv/versions/2.2.3/bin/rspec:23:in `load'
    from /Users/progm/.rbenv/versions/2.2.3/bin/rspec:23:in `<main>'

I can't understand why JSON is a problem. Maybe a dependency problem with neo4j?

ProGM commented 8 years ago

Adding a require 'json' in spec is temporary fixing it.

Moving to module-definition_part2 branch fixes #8 , but many specs are failing. Further investigating...

$ rake spec

Neo4j::Server::Spatial
  find the spatial plugin
    can get a description of the spatial plugin
  add a point layer
    can add a simple point layer
    can add a simple point layer with lat and long
  add an editable layer
    can add an editable layer
  get a spatial layer
    can get a layer
  create a spatial index
    can create a spatial index
  add geometry to spatial layer
    can add a geometry
  update geometry from spatial layer
    can update a geometry
  add a node to a layer
    can add a node to a simple point layer
  find geometries in a bounding box
    can find a geometry in a bounding box (FAILED - 1)
    can find a geometry in a bounding box using cypher
    can find a geometry in a bounding box using cypher two
  find geometries within distance
    can find a geometry within distance (FAILED - 2)
    can find a geometry within distance using cypher
    can find a geometry within distance using cypher 2
  ActiveNode integration
    is a QueryProxy (FAILED - 3)
    matches to the node in the spatial index (FAILED - 4)
    only returns expected nodes (FAILED - 5)

Failures:

  1) Neo4j::Server::Spatial find geometries in a bounding box can find a geometry in a bounding box
     Failure/Error: expect(node.first[:data][:name]).to eq("Max's Restaurant")

       expected: "Max's Restaurant"
            got: nil

       (compared using ==)
     # ./spec/neo4jrb_spatial_spec.rb:101:in `block (3 levels) in <top (required)>'

  2) Neo4j::Server::Spatial find geometries within distance can find a geometry within distance
     Failure/Error: expect(node.first[:data][:name]).to eq("Max's Restaurant")

       expected: "Max's Restaurant"
            got: nil

       (compared using ==)
     # ./spec/neo4jrb_spatial_spec.rb:134:in `block (3 levels) in <top (required)>'

  3) Neo4j::Server::Spatial ActiveNode integration is a QueryProxy
     Failure/Error: let(:match) { Restaurant.all.spatial_match(:r, 'withinDistance:[60.0,15.0,100.0]') }

     NoMethodError:
       undefined method `spatial_match' for #<QueryProxy Restaurant CYPHER: "MATCH (n:`Restaurant`)">
     # ./spec/neo4jrb_spatial_spec.rb:177:in `block (3 levels) in <top (required)>'
     # ./spec/neo4jrb_spatial_spec.rb:180:in `block (3 levels) in <top (required)>'

  4) Neo4j::Server::Spatial ActiveNode integration matches to the node in the spatial index
     Failure/Error: let(:match) { Restaurant.all.spatial_match(:r, 'withinDistance:[60.0,15.0,100.0]') }

     NoMethodError:
       undefined method `spatial_match' for #<QueryProxy Restaurant CYPHER: "MATCH (n:`Restaurant`)">
     # ./spec/neo4jrb_spatial_spec.rb:177:in `block (3 levels) in <top (required)>'
     # ./spec/neo4jrb_spatial_spec.rb:184:in `block (3 levels) in <top (required)>'

  5) Neo4j::Server::Spatial ActiveNode integration only returns expected nodes
     Failure/Error: let(:match) { Restaurant.all.spatial_match(:r, 'withinDistance:[60.0,15.0,100.0]') }

     NoMethodError:
       undefined method `spatial_match' for #<QueryProxy Restaurant CYPHER: "MATCH (n:`Restaurant`)">
     # ./spec/neo4jrb_spatial_spec.rb:177:in `block (3 levels) in <top (required)>'
     # ./spec/neo4jrb_spatial_spec.rb:188:in `block (3 levels) in <top (required)>'

Finished in 4.04 seconds (files took 2.05 seconds to load)
18 examples, 5 failures

Failed examples:

rspec ./spec/neo4jrb_spatial_spec.rb:95 # Neo4j::Server::Spatial find geometries in a bounding box can find a geometry in a bounding box
rspec ./spec/neo4jrb_spatial_spec.rb:128 # Neo4j::Server::Spatial find geometries within distance can find a geometry within distance
rspec ./spec/neo4jrb_spatial_spec.rb:179 # Neo4j::Server::Spatial ActiveNode integration is a QueryProxy
rspec ./spec/neo4jrb_spatial_spec.rb:183 # Neo4j::Server::Spatial ActiveNode integration matches to the node in the spatial index
rspec ./spec/neo4jrb_spatial_spec.rb:187 # Neo4j::Server::Spatial ActiveNode integration only returns expected nodes