Sha256: 871b28e4665b981aa0fbe57bfc9c3d4f37416111c300f8838216e403ccd16550
Contents?: true
Size: 1.06 KB
Versions: 2
Compression:
Stored size: 1.06 KB
Contents
require 'spec_helper' # - www.movable-type.co.uk/scripts/latlong.html describe GeoPoint do describe 'ruby core Class extensions' do describe 'Array extension' do describe '#to_lat' do it 'should return latitude as first element' do @arr = [4, 27] @arr.to_lat.should == 4 end it 'should return latitude as #to_lng of first element' do @arr = ["4.1", 27] @arr.to_lat.should == 4.1 end end describe '#to_lng' do it 'should return latitude degree value for 360' do @arr = [4, 27] @arr.to_lng.should == 27 end it 'should return latitude as #to_lng of first element' do @arr = [4, "27.2"] @arr.to_lng.should == 27.2 end end describe '#to_lat_lng' do it 'should return Array with lat, lng' do @arr = ["3", {:lng => "2"}] @arr.to_lat_lng.should == [3, 2] end end end # Array end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
geo_calc-0.7.4 | spec/geo_calc/core_ext/array_ext_spec.rb |
geo_calc-0.7.3 | spec/geo_calc/core_ext/array_ext_spec.rb |