Sha256: 96d208d4f054e1822fd0a9a4fb0c901b72764a3a00fc62c58dc77074111e44a4

Contents?: true

Size: 594 Bytes

Versions: 11

Compression:

Stored size: 594 Bytes

Contents

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

class TestGmanCountryCodes < Minitest::Test
  should "determine a domain's country" do
    assert_equal "United States of America", Gman.new("whitehouse.gov").country.name
    assert_equal "United States of America", Gman.new("army.mil").country.name
    assert_equal "United Kingdom of Great Britain and Northern Ireland", Gman.new("foo.gov.uk").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

11 entries across 11 versions & 1 rubygems

Version Path
gman-5.0.9 test/test_gman_country_codes.rb
gman-5.0.8 test/test_gman_country_codes.rb
gman-5.0.7 test/test_gman_country_codes.rb
gman-5.0.6 test/test_gman_country_codes.rb
gman-5.0.5 test/test_gman_country_codes.rb
gman-5.0.4 test/test_gman_country_codes.rb
gman-5.0.3 test/test_gman_country_codes.rb
gman-5.0.2 test/test_gman_country_codes.rb
gman-5.0.1 test/test_gman_country_codes.rb
gman-5.0.0 test/test_gman_country_codes.rb
gman-4.7.1 test/test_gman_country_codes.rb