Skip to content
Browse files

+ Estonia Premium

  • Loading branch information...
1 parent 41c0cf7 commit 605ab72298f3b2442d46281f4a4238fba7826b6e @floere committed Oct 11, 2012
Showing with 7 additions and 5 deletions.
  1. +3 −3 lib/phony/countries.rb
  2. +4 −2 spec/lib/phony/countries_spec.rb
View
6 lib/phony/countries.rb
@@ -422,9 +422,9 @@
# Estonia
country '372',
- match(/^(5\d\d\d)\d+$/) >> split(4) | # Mobile
- match(/^(8[12]\d\d)\d+$/) >> split(4) | # Mobile
- fixed(3) >> split(4) # 3-digit NDCs
+ match(/^(5\d\d\d)\d+$/) >> split(4) | # Mobile
+ match(/^((?:70|8[12])\d\d)\d+$/) >> split(4) | # Mobile
+ fixed(3) >> split(4) # 3-digit NDCs
country '373', todo # Moldova
country '374', todo # Armenia
View
6 spec/lib/phony/countries_spec.rb
@@ -83,11 +83,13 @@ def self.it_splits number, expected
it_splits '20951234567', ['20', '95', '1234567']
end
describe 'Estonia' do
- it_splits '3723212345', ['372', '321', '2345'] # Landline
+ it_splits '3723212345', ['372', '321', '2345'] # Landline
it_splits '37251231234', ['372', '5123', '1234'] # Mobile
- it_splits '3728001234', ['372', '800', '1234'] # Freephone
+ it_splits '3728001234', ['372', '800', '1234'] # Freephone
it_splits '37281231234', ['372', '8123', '1234'] # Mobile
it_splits '37282231234', ['372', '8223', '1234'] # Mobile
+ it_splits '37283212345', ['372', '832', '12345'] # Mobile
+ it_splits '37270121234', ['372', '7012', '1234'] # Premium
end
describe 'Finland' do
it_splits '3589123123', ['358', '9', '123', '123'] # Helsinki

0 comments on commit 605ab72

Please sign in to comment.
Something went wrong with that request. Please try again.