Skip to content

Commit

Permalink
Merge 6c3c661 into 0e5eb75
Browse files Browse the repository at this point in the history
  • Loading branch information
ewamarciniak committed Sep 1, 2017
2 parents 0e5eb75 + 6c3c661 commit 117a5b5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/phony/countries.rb
Expand Up @@ -279,7 +279,10 @@
# Singapore (Republic of).
#
country '65',
none >> split(4,4) # TODO Short Codes.
none >> matched_split(
/^(800)\d{7}$/ => [3,3,4], # International Toll Free Service (ITFS) and Home Country Direct Service (HCDS) Numbers
/^\d{8}$/ => [4,4] # TODO Short Codes
)

# Thailand.
#
Expand Down
2 changes: 2 additions & 0 deletions spec/functional/plausibility_spec.rb
Expand Up @@ -268,6 +268,8 @@ def self.it_is_correct_for(country_name, options={})
['+381 62 12 34567', '+381 62 12 3456'],
['+381 65 12 34567', '+381 65 12 3456']]
it_is_correct_for 'Sierra Leone', :samples => '+232 42 393 972'
it_is_correct_for 'Singapore', :samples => ['+65 6123 1234',
'+65 800 852 1234']
it_is_correct_for 'Solomon Islands', :samples => '+677 97851'
it_is_correct_for 'Somali Democratic Republic', :samples => ['+252 1034 123 45',
'+252 1313 123',
Expand Down
3 changes: 2 additions & 1 deletion spec/lib/phony/countries_spec.rb
Expand Up @@ -661,7 +661,8 @@ def self.it_splits number, expected
end

describe 'Singapore' do
it_splits '6561231234', ['65', false, '6123', '1234'] # Fixed line
it_splits '6561231234', ['65', false, '6123', '1234'] # Fixed line
it_splits '658008521234', ['65', false, '800', '852', '1234'] # International Toll Free Service (ITFS) and Home Country Direct Service (HCDS) Numbers
end
describe 'Slovakia' do
it_splits '421912123456', ['421', '912', '123456'] # Mobile
Expand Down

0 comments on commit 117a5b5

Please sign in to comment.