Skip to content

Commit

Permalink
Merge pull request floere#353 from Uelb/master
Browse files Browse the repository at this point in the history
Adapt mobile phone splitting of Belgium to respect the specifications
  • Loading branch information
floere authored Jan 16, 2017
2 parents 3c7870c + 88f8514 commit 266a7bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/phony/countries.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@
# http://en.wikipedia.org/wiki/Telephone_numbers_in_Belgium
#
country '32', trunk('0') |
match(/^(70|800|90\d)\d+$/) >> split(3,3) | # Service
match(/^(7[08])\d+$/) >> split(3,3) | # Premium and national rate Services
match(/^(800|90\d)\d+$/) >> split(2,3) | # Toll free service and premium numbers
match(/^(46[0568])\d{6}$/) >> split(2,2,2) | # Mobile (Lycamobile, Telenet, Proximus 0460)
match(/^(4[789]\d)\d{6}$/) >> split(2,2,2) | # Mobile
one_of('2','3','4','9') >> split(3,2,2) | # Short NDCs
Expand Down
3 changes: 3 additions & 0 deletions spec/lib/phony/countries_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ def self.it_splits number, expected
it_splits '32475279584', ['32', '475', '27', '95', '84'] # mobile
it_splits '32468279584', ['32', '468', '27', '95', '84'] # mobile (Telenet)
it_splits '3270123123', ['32', '70', '123', '123'] # Bus Service?
it_splits '3278123123', ['32', '78', '123', '123'] # National rate service
it_splits '3290123123', ['32', '901', '23', '123'] # National rate service
it_splits '3280080404', ['32', '800', '80', '404'] # Apple support
end

describe 'Belize' do
Expand Down

0 comments on commit 266a7bc

Please sign in to comment.