diff --git a/lib/phony/countries.rb b/lib/phony/countries.rb index d5b77793..d699b5d9 100644 --- a/lib/phony/countries.rb +++ b/lib/phony/countries.rb @@ -1255,7 +1255,11 @@ one_of(%w[92 97]) >> split(3) | # mobile fixed(2) >> split(3, 3) - country '975', fixed(1) >> split(3, 3) # Bhutan (Kingdom of) http://www.wtng.info/wtng-975-bt.html + # Bhutan (Kingdom of) + # https://en.wikipedia.org/wiki/Telephone_numbers_in_Bhutan + country '975', + one_of(%w(16 17 77)) >> split(3, 3) | # Mobile + one_of(%w(2)) >> split(3, 3) # Landline # Mongolia # https://www.numberingplans.com/?page=plans&sub=phonenr&alpha_2_input=MN diff --git a/qed/plausibility.md b/qed/plausibility.md index 29f1800f..b64ce331 100644 --- a/qed/plausibility.md +++ b/qed/plausibility.md @@ -228,7 +228,18 @@ NDC with several subscriber number length. #### Bhutan - plausible? true: '+975 2 889 648' +https://en.wikipedia.org/wiki/Telephone_numbers_in_Bhutan + + Phony.assert.plausible?("+975 2 889 648") # Landline + Phony.assert.plausible?("+975 17 889 648") # B-Mobile + Phony.assert.plausible?("+975 16 889 648") # B-Mobile + Phony.assert.plausible?("+975 77 889 648") # TashiCell + + Phony.refute.plausible?("+975 77 889 6489") # B-Mobile (too long) + Phony.refute.plausible?("+975 77 889 64") # B-Mobile (too short) + Phony.refute.plausible?("+975 3 889 648") # Not a landline + Phony.refute.plausible?("+975 2 889 64") # Landline too short + Phony.refute.plausible?("+975 2 889 6489") # Landline too long #### Bolivia diff --git a/spec/lib/phony/countries_spec.rb b/spec/lib/phony/countries_spec.rb index dd73f4c5..f054b3e4 100644 --- a/spec/lib/phony/countries_spec.rb +++ b/spec/lib/phony/countries_spec.rb @@ -954,7 +954,10 @@ def self.it_splits(number, expected) end describe 'Bhutan (Kingdom of)' do - it_splits '9759723642', %w[975 9 723 642] + it_splits '9752972364', %w(975 2 972 364) + it_splits '97516297236', %w(975 16 297 236) + it_splits '97517297236', %w(975 17 297 236) + it_splits '97577297236', %w(975 77 297 236) end describe 'Brunei Darussalam' do