Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

+ changed formatting of morrocan mobile numbers

  • Loading branch information...
commit 8044f3f76df4432d0af7431a1dcca19f155e070e 1 parent 2607f31
@jcfischer jcfischer authored committed
Showing with 7 additions and 1 deletion.
  1. +6 −1 lib/phony/countries.rb
  2. +1 −0  spec/lib/phony/countries_spec.rb
View
7 lib/phony/countries.rb
@@ -272,7 +272,12 @@
country '210', todo # -
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 '214', todo # -
country '215', todo # -
View
1  spec/lib/phony/countries_spec.rb
@@ -236,6 +236,7 @@ def self.it_splits number, expected
end
describe 'Morocco' do
it_splits '212537718685', ['212', '53', '7718', '685']
+ it_splits '212612345678', ['212', '6', '12', '34', '56', '78']
end
describe 'The Netherlands' do
it_splits '31612345678', ['31', '6', '12', '34', '56', '78'] # mobile
Please sign in to comment.
Something went wrong with that request. Please try again.