Sha256: a66f183091e9581f8a7dd01de32c0c0a007735be43bd76224a4b64ad91cb4242

Contents?: true

Size: 865 Bytes

Versions: 5

Compression:

Stored size: 865 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe "Ip2location" do
  it "work correctly with country get_country_info field" do
    country = Ip2locationCountry.new('./data/IP2LOCATION-COUNTRY-INFORMATION-BASIC.CSV')
    record = country.get_country_info('US')
    expect(record).to include("country_code")
  end

  it "work correctly with country get_country_info value" do
    country = Ip2locationCountry.new('./data/IP2LOCATION-COUNTRY-INFORMATION-BASIC.CSV')
    record = country.get_country_info('US')
    expect(record["country_code"]).to eq 'US'
  end

  it "work correctly with country get_country_info capital" do
    country = Ip2locationCountry.new('./data/IP2LOCATION-COUNTRY-INFORMATION-BASIC.CSV')
    record = country.get_country_info('MY')
    expect(record["capital"]).to eq 'Kuala Lumpur'
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ip2location_ruby-8.7.3 spec/ip2location_ruby_country_spec.rb
ip2location_ruby-8.7.2 spec/ip2location_ruby_country_spec.rb
ip2location_ruby-8.7.1 spec/ip2location_ruby_country_spec.rb
ip2location_ruby-8.7.0 spec/ip2location_ruby_country_spec.rb
ip2location_ruby-8.6.0 spec/ip2location_ruby_country_spec.rb