Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
+ Estonia Premium
  • Loading branch information
floere committed Oct 10, 2012
1 parent 41c0cf7 commit 605ab72
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/phony/countries.rb
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions spec/lib/phony/countries_spec.rb
Expand Up @@ -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
Expand Down

0 comments on commit 605ab72

Please sign in to comment.