Sha256: fd5734b956c09ba72a5ed70b0399273fcee9a4a0aa6589728a1a101bc8be2cda

Contents?: true

Size: 628 Bytes

Versions: 4

Compression:

Stored size: 628 Bytes

Contents

require File.join(File.dirname(__FILE__), 'helper')

class TestGmanCountryCodes < Minitest::Test
  should "determine a domain's country" do
    name = Gman.new('whitehouse.gov').country.name
    assert_equal 'United States of America', name

    name = Gman.new('foo.gov.uk').country.name
    assert_equal 'United Kingdom of Great Britain and Northern Ireland', name

    assert_equal 'United States of America', Gman.new('army.mil').country.name
    assert_equal 'Canada', Gman.new('foo.gc.ca').country.name
  end

  should 'not err out on an unknown country code' do
    assert_equal nil, Gman.new('foo.eu').country
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
gman-7.0.1 test/test_gman_country_codes.rb
gman-7.0.0 test/test_gman_country_codes.rb
gman-6.0.1 test/test_gman_country_codes.rb
gman-6.0.0 test/test_gman_country_codes.rb