Sha256: ce9b50c6ad2333c2be19713d63e47994b505ee18d432a1f7dba3cd875f51e545

Contents?: true

Size: 872 Bytes

Versions: 2

Compression:

Stored size: 872 Bytes

Contents

describe "Geolookup::Country" do
  describe "#name_to_code" do
    it "returns a country name if country code matches" do
      expect(Geolookup::Country.code_to_name("AL")).to eql("Albania")
    end

    it "returns a country code if country name matches" do
      expect(Geolookup::Country.name_to_code("Hong Kong")).to eql("HK")
    end

    it "returns a lat/long array if country name matches" do
      expect(Geolookup::Country.name_to_lat_long("United States")).to eql([38000000, -97000000])
    end
  end
  
  describe "#find_country_phone_code" do
    it "expects a country phone code when given a country code" do
      expect(Geolookup::Country::PhoneCodes.country_to_phone_code('DZ')).to eq(213)
    end
    
    it "expects an array of country phone codes" do
      expect(Geolookup::Country::PhoneCodes.country_phone_codes).to include(213)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
geolookup-0.6.4 spec/lib/country_spec.rb
geolookup-0.6.2 spec/lib/country_spec.rb