Sha256: 75bad975ac87b467b8c6d92eec80ff1d98611e5c170b3d23cb4d1e96258a94ea

Contents?: true

Size: 688 Bytes

Versions: 5

Compression:

Stored size: 688 Bytes

Contents

require 'spec_helper'


describe GeoNamesAPI::CountrySubdivision do
  def should_be_sf(result)
    result.should be_present
    result.admin_code1.should == 'CA'
    result.admin_name1.should == 'California'
    result.country_code.should == 'US'
    result.country_name.should == 'United States'
  end

  describe '::find' do
    it 'should find one subdivision' do
      result = GeoNamesAPI::CountrySubdivision.find(37.8, -122.4)
      should_be_sf(result)
    end
  end

  describe '::all' do
    it 'should find multiple subdivisions' do
      result = GeoNamesAPI::CountrySubdivision.all(37.8, -122.4)
      result.size.should > 0
      should_be_sf(result.first)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
geonames_api-0.1.4 spec/geonames_api/country_subdivision_spec.rb
geonames_api-0.1.3 spec/geonames_api/country_subdivision_spec.rb
geonames_api-0.1.2 spec/geonames_api/country_subdivision_spec.rb
geonames_api-0.1.1 spec/geonames_api/country_subdivision_spec.rb
geonames_api-0.1.0 spec/geonames_api/country_subdivision_spec.rb