Changed bahavior upgrading from 0.8.0 to 0.8.1
tilo opened this issue · 8 comments
tilo commented
looks like the API for PhoneLib changed from version 0.8.0 to 0.8.1
before you could do this:
phone = Phonelib.parse(phone_number, ["US", "CA"])
now you have to do this:
phone = nil
phone ||= Phonelib.parse(phone_number, "US")
phone ||= Phonelib.parse(phone_number, "CA")
- such a change in behavior should be caught by failing tests in PhoneLib
-> there was no test coverage - any change in behavior should rev-up more than just the last digit of the version
-> see https://semver.org/
daddyz commented
@tilo interesting undocumented behavior. I never saw that method being used like that, it's not documented and not tested. I tried it locally on 0.8.9 and it works. Can you specify your ruby version?
tilo commented
daddyz commented
regardless, there is a configuration option that allows several countries:
Phonelib.default_country = ['US', 'CA']
phone = Phonelib.parse(phone_number)
daddyz commented
@tilo check version 0.9.1, I saw this happening for possible numbers only, with valid numbers it was working properly
tilo commented
looks like our tests are passing with 0.9.1
daddyz commented
great, closing the issue