Sha256: 2ef0382bba51bbec085fcfa6848330cc7ce29fc12a4a59e2640a2806840b96b5
Contents?: true
Size: 1.31 KB
Versions: 4
Compression:
Stored size: 1.31 KB
Contents
describe GeoPoint do describe 'ruby core Class extensions' do describe 'Hash extension' do describe '#to_lat' do it 'should return latitude as #to_lat on the value for key :lat' do @hash = {:lat => 4} @hash.to_lat.should == 4 end it 'should return latitude as #to_lat on the value for key :latitude' do @hash = {:latitude => "7"} @hash.to_lat.should == 7 end end describe '#to_lng' do it 'should return latitude as #to_lng on the value for key :lng' do @hash = {:lng => 2} @hash.to_lng.should == 2 end it 'should return latitude as #to_lng on the value for key :longitude' do @hash = {:longitude => "3.1"} @hash.to_lng.should == 3.1 end end describe '#to_lat_lng' do it 'should return Array with lat, lng' do @hash = {:lng => 2, :lat => "3"} @hash.to_lat_lng.should == [3, 2] end end describe '#geo_point' do it 'should return a GeoPoint' do @p = {:lng => 2, :lat => "3"}.geo_point @p.should be_a(GeoPoint) @p.to_lat_lng.should == [3, 2] end end end # Hash end end
Version data entries
4 entries across 4 versions & 1 rubygems