Skip to content

Commit

Permalink
Update country_test to make it more clear that country.code doesn't r…
Browse files Browse the repository at this point in the history
…eturn an Array anymore
  • Loading branch information
Soleone committed Dec 16, 2010
1 parent 8f9ab56 commit 99e3fb2
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions test/unit/country_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ class CountryTest < Test::Unit::TestCase

def test_country_from_hash
country = Country.new(:name => 'Canada', :alpha2 => 'CA', :alpha3 => 'CAN', :numeric => '124')
assert_equal 'CA', country.code(:alpha2).to_s
assert_equal 'CAN', country.code(:alpha3).to_s
assert_equal '124', country.code(:numeric).to_s
assert_equal 'CA', country.code(:alpha2).value
assert_equal 'CAN', country.code(:alpha3).value
assert_equal '124', country.code(:numeric).value
assert_equal 'Canada', country.to_s
end

def test_country_for_alpha2_code
country = Country.find('CA')
assert_equal 'CA', country.code(:alpha2).to_s
assert_equal 'CAN', country.code(:alpha3).to_s
assert_equal '124', country.code(:numeric).to_s
assert_equal 'CA', country.code(:alpha2).value
assert_equal 'CAN', country.code(:alpha3).value
assert_equal '124', country.code(:numeric).value
assert_equal 'Canada', country.to_s
end

Expand All @@ -42,18 +42,18 @@ def test_find_unknown_country_name

def test_find_australia
country = Country.find('AU')
assert_equal 'AU', country.code(:alpha2).to_s
assert_equal 'AU', country.code(:alpha2).value

country = Country.find('Australia')
assert_equal 'AU', country.code(:alpha2).to_s
assert_equal 'AU', country.code(:alpha2).value
end

def test_find_united_kingdom
country = Country.find('GB')
assert_equal 'GB', country.code(:alpha2).to_s
assert_equal 'GB', country.code(:alpha2).value

country = Country.find('United Kingdom')
assert_equal 'GB', country.code(:alpha2).to_s
assert_equal 'GB', country.code(:alpha2).value
end

def test_raise_on_nil_name
Expand Down

0 comments on commit 99e3fb2

Please sign in to comment.