From 99e3fb2f1a04509c22ba14ee19581ed074e4e907 Mon Sep 17 00:00:00 2001 From: Dennis Theisen Date: Thu, 16 Dec 2010 17:48:44 -0500 Subject: [PATCH] Update country_test to make it more clear that country.code doesn't return an Array anymore --- test/unit/country_test.rb | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/unit/country_test.rb b/test/unit/country_test.rb index 0d5777d7429..4a577896ee3 100644 --- a/test/unit/country_test.rb +++ b/test/unit/country_test.rb @@ -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 @@ -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