Skip to content

Commit

Permalink
Fix Indonesian plausibility and split for 21 (Jakarta) code area and …
Browse files Browse the repository at this point in the history
…7 digits local numbers
  • Loading branch information
aprimadi committed May 21, 2014
1 parent 8a78f9d commit 8cd43ac
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/phony/countries/indonesia.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
country '62',
one_of('21') >> matched_split(
/\A\d{5}\z/ => [3,2],
/\A\d{7}\z/ => [3,4],
/\A\d+\z/ => [4,4]) |
one_of(%w(22 23 24 25 26 27 28 29 31 32 33 34 35 36 37 38 39 72)) >> matched_split(
/\A\d{5}\z/ => [3,2],
Expand Down
2 changes: 1 addition & 1 deletion spec/functional/plausibility_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ def self.it_is_correct_for(country_name, options={})
'+62 178 123',
'+62 178 123 45',
'+62 21 123 45',
'+62 21 1234 5567',
['+62 21 123 4567', '+62 21 1234 5567'],
'+62 22 123 45',
'+62 22 123 4567',
'+62 4 311 234',
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/phony/countries_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def self.it_splits number, expected
describe 'Indonesia' do
it_splits '6242323032', ["62", "4", "2323", "032"]
it_splits '6285220119289', ['62', '852', '2011', '9289']
it_splits '62217815263', ['62', '21', '7815', '263']
it_splits '62217815263', %w(62 21 781 5263)
it_splits '6213123', %w(62 13 123)
it_splits '6213123456', %w(62 13 123 456)
it_splits '6217412', %w(62 174 12)
Expand Down

0 comments on commit 8cd43ac

Please sign in to comment.