Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

+ Venezuela, Olaaaa!, + specs

  • Loading branch information...
commit 74333d36ddef347c6b9844d0af53e32eae6cfbcc 1 parent 38df79e
@floere authored
Showing with 22 additions and 17 deletions.
  1. +19 −17 lib/phony/countries/all_other.rb
  2. +3 −0  spec/lib/phony_spec.rb
View
36 lib/phony/countries/all_other.rb
@@ -97,8 +97,10 @@ def self.mapping
), # http://en.wikipedia.org/wiki/Telephone_numbers_in_Brazil
'56' => Countries::Chile,
'57' => fixed(2), # TODO Colombia (Republic of)
- '58' => fixed(2), # TODO Venezuela (Bolivarian Republic of)
-
+ '58' => fixed(3, # Venezuela (Bolivarian Republic of)
+ :local_format => [7]
+ ),
+
'60' => fixed(2), # TODO Malaysia
'61' => fixed(1, # Australia
:local_format => [4, 4]
@@ -108,25 +110,25 @@ def self.mapping
'64' => fixed(1, # New Zealand
:local_format => [3, 4]
),
- # TODO From here on.
- #
- '65' => fixed(2), # Singapore (Republic of)
- '66' => fixed(2), # Thailand
+ '65' => fixed(2), # TODO Singapore (Republic of)
+ '66' => fixed(2), # TODO Thailand
- '81' => fixed(2), # Japan
- '82' => fixed(2), # Korea (Republic of)
- '84' => fixed(2), # Viet Nam (Socialist Republic of)
- '86' => fixed(2), # China (People's Republic of)
+ '81' => fixed(2), # TODO Japan
+ '82' => fixed(2), # TODO Korea (Republic of)
+ '84' => fixed(2), # TODO Viet Nam (Socialist Republic of)
+ '86' => fixed(2), # TODO China (People's Republic of)
- '90' => fixed(2), # Turkey
- '91' => fixed(2), # India (Republic of)
- '92' => fixed(2), # Pakistan (Islamic Republic of)
- '93' => fixed(2), # Afghanistan
- '94' => fixed(2), # Sri Lanka (Democratic Socialist Republic of)
- '95' => fixed(2), # Myanmar (Union of)
- '98' => fixed(2), #Iran (Islamic Republic of)
+ '90' => fixed(2), # TODO Turkey
+ '91' => fixed(2), # TODO India (Republic of)
+ '92' => fixed(2), # TODO Pakistan (Islamic Republic of)
+ '93' => fixed(2), # TODO Afghanistan
+ '94' => fixed(2), # TODO Sri Lanka (Democratic Socialist Republic of)
+ '95' => fixed(2), # TODO Myanmar (Union of)
+ '98' => fixed(2), # TODO Iran (Islamic Republic of)
},
3 => {
+ # TODO From here on.
+ #
'210' => fixed(2), # -
'211' => fixed(2), # -
'212' => fixed(2), # Morocco
View
3  spec/lib/phony_spec.rb
@@ -71,6 +71,9 @@
it "should handle US numbers" do
Phony.split('15551115511').should == ['1', '555', '111', '5511']
end
+ it "should handle venezuelan numbers" do
+ Phony.split('582121234567').should == ["58", "212", "1234567"]
+ end
it "should handle new zealand numbers" do
Phony.split('6491234567').should == ['64', '9', '123', '4567']
end
Please sign in to comment.
Something went wrong with that request. Please try again.