Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with 9 digits brazilian mobile phones #90

Open
danicuki opened this issue May 23, 2019 · 1 comment
Open

Problems with 9 digits brazilian mobile phones #90

danicuki opened this issue May 23, 2019 · 1 comment

Comments

@danicuki
Copy link

Some Brazilian mobile phones now have 9 digits.

Example:

This works
(Phonie::Phone.parse '31992211568', country_code: '55').area_code
31

But when area code is passed in the options instead of number:
(Phonie::Phone.parse '992211568', area_code: '31', country_code: '55').area_code
returns 99 and should return 31

@danicuki
Copy link
Author

test case that should pass:

  def test_mobile_area_code_as_option_with_9
    pn = Phonie::Phone.parse('987655678', { country_code: '55', area_code: '21' })
    assert_equal pn.country_code, '55'
    assert_equal pn.area_code, '21'
    assert_equal pn.number, '987655678'    
  end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant