Sha256: a7c7352f832f53b0eddac333e670b05440d9ba728291d7e980537edbd7c45f9a

Contents?: true

Size: 935 Bytes

Versions: 7

Compression:

Stored size: 935 Bytes

Contents

require 'spec_helper'

# - www.movable-type.co.uk/scripts/latlong.html
describe GeoPoint do  
  describe 'Class methods' do     
    describe '#coord_mode' do
      it 'should change global coordinates mode' do
        GeoPoint.coord_mode = :lng_lat
        GeoPoint.coord_mode.should == :lng_lat        

        GeoPoint.coord_mode = :lat_lng
        GeoPoint.coord_mode.should == :lat_lng                        
      end
      
      it 'shoould not allow setting invalid coord mode' do
        lambda { GeoPoint.coord_mode = :blip }.should raise_error
      end
    end
    
    describe '#earth_radius_km' do
      it 'should change global earth_radius_km' do
        GeoPoint.earth_radius_km = 6360
        GeoPoint.earth_radius_km.should == 6360
      end
      
      it 'shoould not allow setting invalid earth radius' do
        lambda { GeoPoint.earth_radius_km = 6100 }.should raise_error
      end    
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
geo_point-0.2.6 spec/geo_point/class_methods_spec.rb
geo_point-0.2.5 spec/geo_point/class_methods_spec.rb
geo_point-0.2.3 spec/geo_point/class_methods_spec.rb
geo_point-0.2.1 spec/geo_point/class_methods_spec.rb
geo_point-0.2.0 spec/geo_point/class_methods_spec.rb
geo_point-0.1.0 spec/geo_point/class_methods_spec.rb
geo_calc-0.7.1 spec/geo_calc/geo_point/class_methods_spec.rb