Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/active_utils/country.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Country
attr_reader :name

def initialize(options = {})
requires!(options, :name, :alpha2, :alpha3, :numeric)
requires!(options, :name, :alpha2, :alpha3)
@name = options.delete(:name)
@codes = options.collect{|k,v| CountryCode.new(v)}
end
Expand Down
6 changes: 6 additions & 0 deletions test/unit/country_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,10 @@ def test_qatar_does_not_use_postal_codes
qatar = Country.find('Qatar')
refute qatar.uses_postal_codes?
end

def test_find_country_without_numeric_code
country = Country.find('ASC')
assert_equal 'Ascension Island', country.to_s
assert_nil country.code(:numeric)
end
end
Loading