Skip to content

Commit

Permalink
+ changed formatting of morrocan mobile numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
jcfischer authored and floere committed Mar 18, 2013
1 parent 2607f31 commit 8044f3f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/phony/countries.rb
Expand Up @@ -272,7 +272,12 @@


country '210', todo # - country '210', todo # -
country '211', todo # South Sudan country '211', todo # South Sudan
country '212', fixed(2) >> split(4,3), length(9) # Morocco
country '212', # Morocco
one_of('6') >> split(2,2,2,2) | # mobile
fixed(2) >> split(4,3),
length(9)

country '213', fixed(2) >> split(3,4), length(9) # Algeria country '213', fixed(2) >> split(3,4), length(9) # Algeria
country '214', todo # - country '214', todo # -
country '215', todo # - country '215', todo # -
Expand Down
1 change: 1 addition & 0 deletions spec/lib/phony/countries_spec.rb
Expand Up @@ -236,6 +236,7 @@ def self.it_splits number, expected
end end
describe 'Morocco' do describe 'Morocco' do
it_splits '212537718685', ['212', '53', '7718', '685'] it_splits '212537718685', ['212', '53', '7718', '685']
it_splits '212612345678', ['212', '6', '12', '34', '56', '78']
end end
describe 'The Netherlands' do describe 'The Netherlands' do
it_splits '31612345678', ['31', '6', '12', '34', '56', '78'] # mobile it_splits '31612345678', ['31', '6', '12', '34', '56', '78'] # mobile
Expand Down

0 comments on commit 8044f3f

Please sign in to comment.