mongoid/mongoid-geospatial

Spec errors

Closed this issue · 2 comments

In order to make the specs run, I had to add a test group to Gemfile:

group :test do
  gem 'dbf'
  gem 'nokogiri'
end
kmandrup:mongoid_geospatial (master) $ bspec spec/
Running with Mongoid v3.0.6
/Users/kmandrup/private/repos/mongoid_geospatial/spec/mongoid_geospatial/wrappers/georuby_spec.rb:2: warning: already initialized constant Point
...................................................F.F....

Failures:

  1) Mongoid::Geospatial::Point queryable (de)mongoize should calculate 3d distances by default
     Failure/Error: bar.location.distance(bar2.location.to_geo).to_i.should be_within(1).of(3978262)
     NoMethodError:
       undefined method `distance' for #<GeoRuby::SimpleFeatures::Point:0x007fafeab79340>
     # ./lib/mongoid_geospatial/wrappers/georuby.rb:8:in `distance'
     # ./spec/mongoid_geospatial/wrappers/georuby_spec.rb:51:in `block (4 levels) in <top (required)>'

  2) Mongoid::Geospatial::Point should not respond to distance before loading external
     Failure/Error: bar.location.should_not respond_to(:distance)
       expected #<Mongoid::Geospatial::Point:0x007fafec2c37f8 @x=5.0, @y=5.0> not to respond to :distance
     # ./spec/mongoid_geospatial/wrappers/rgeo_spec.rb:12:in `block (2 levels) in <top (required)>'

Finished in 1.64 seconds
58 examples, 2 failures

Failed examples:

rspec ./spec/mongoid_geospatial/wrappers/georuby_spec.rb:48 # Mongoid::Geospatial::Point queryable (de)mongoize should calculate 3d distances by default
rspec ./spec/mongoid_geospatial/wrappers/rgeo_spec.rb:10 # Mongoid::Geospatial::Point should not respond to distance before loading external

Please check out HEAD. specs green.
Thank you.

Sweet :)