Sha256: 9068ba1ba3daf9383c9e3f8c9398a17a8188558fe6314e178bae9a5ff0aeaf74

Contents?: true

Size: 1.01 KB

Versions: 15

Compression:

Stored size: 1.01 KB

Contents

describe "Geolookup::USA::County" do
  describe "#code_to_name" do
    it "given a state code, and a county code return the name of the county" do
      expect(Geolookup::USA::County.code_to_name(1, 1)).to eql("AUTAUGA")
    end

    it "should return nil if state key doesn't match" do
      expect(Geolookup::USA::County.code_to_name('yo', 1)).to be_nil
    end
  end

  describe "#code_to_lat_longs" do
    it "given a state code and county code return a lat / long" do
      lat_long = Geolookup::USA::County.code_to_lat_long(1, 1)
      expect(lat_long).to be_kind_of(Array)
    end

    it "should return nil if state key doesn't match" do
      expect(Geolookup::USA::County.code_to_lat_long('yo', 1)).to be_nil
    end
  end

  describe "#name_to_code" do
    it "should return a county code" do
      expect(Geolookup::USA::County.name_to_code(1, 'auTAUGA')).to eql(1)
    end

    it "should return nil if state key doesn't match" do
      expect(Geolookup::USA::County.name_to_code('yo', 'auTAUGA')).to be_nil
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
geolookup-0.6.4 spec/lib/county_spec.rb
geolookup-0.6.2 spec/lib/county_spec.rb
geolookup-0.6.1 spec/lib/county_spec.rb
geolookup-0.6.0 spec/lib/county_spec.rb
geolookup-0.5.10 spec/lib/county_spec.rb
geolookup-0.5.9 spec/lib/county_spec.rb
geolookup-0.5.8 spec/lib/county_spec.rb
geolookup-0.5.7 spec/lib/county_spec.rb
geolookup-0.5.6 spec/lib/county_spec.rb
geolookup-0.5.5 spec/lib/county_spec.rb
geolookup-0.5.4 spec/lib/county_spec.rb
geolookup-0.5.3 spec/lib/county_spec.rb
geolookup-0.5.2 spec/lib/county_spec.rb
geolookup-0.5.1 spec/lib/county_spec.rb
geolookup-0.5.0 spec/lib/county_spec.rb