Browse files

+ update formatting of NL numbers

  • Loading branch information...
1 parent abb8f48 commit bd896ad7e405f65233cd8865fb60903742d7e7af @jcfischer jcfischer committed with Dec 11, 2012
Showing with 7 additions and 5 deletions.
  1. +4 −2 lib/phony/countries/netherlands.rb
  2. +3 −3 spec/lib/phony/countries_spec.rb
View
6 lib/phony/countries/netherlands.rb
@@ -52,6 +52,8 @@
Phony.define do
country '31', one_of(service) >> split(3,3) |
- one_of(['6'] + ndcs) >> split(8) | # mobile + landline
- fixed(3) >> split(8) # 8 is for mobile numbers, other numbers will work as well (they use 7).
+ one_of('6') >> split(2,2,2,2) | # mobile
+ one_of(ndcs) >> split(3,4) | # landline (geographic region)
+ fixed(3) >> split(3,3), # 3 digit ndc
+ length(9)
end
View
6 spec/lib/phony/countries_spec.rb
@@ -238,9 +238,9 @@ def self.it_splits number, expected
it_splits '212537718685', ['212', '53', '7718', '685']
end
describe 'The Netherlands' do
- it_splits '31612345678', ['31', '6', '12345678'] # mobile
- it_splits '31201234567', ['31', '20', '1234567']
- it_splits '31222123456', ['31', '222', '123456']
+ it_splits '31612345678', ['31', '6', '12', '34', '56', '78'] # mobile
+ it_splits '31201234567', ['31', '20', '123', '4567']
+ it_splits '31222123456', ['31', '222', '123', '456']
end
describe 'Norway' do
it_splits '4721234567', ['47',false,'21','23','45','67']

0 comments on commit bd896ad

Please sign in to comment.