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

feat: add danish country code #2818

Merged
merged 3 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/locales/da-DK.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ da-DK:
- "#{first_name} #{last_name} #{last_name}"
- "#{first_name} #{last_name} #{last_name}"

country_code: ['45']

phone_number:
formats:
- '## ## ## ##'
Expand Down
6 changes: 6 additions & 0 deletions test/test_da_dk_locale.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,10 @@ def test_da_dk_phone_number_methods
assert_match(/(20)|(30)|(40)[\d\s]+$/, Faker::PhoneNumber.cell_phone)
assert_match(/(\d\d[\s-]?){4}$/, Faker::PhoneNumber.phone_number)
end

def test_da_dk_counrty_code
assert_equal '+45', Faker::PhoneNumber.country_code
assert_match(/(\+45)[\s](\d\d[\s-]?){4}$/, Faker::PhoneNumber.phone_number_with_country_code)
assert_match(/(\+45)[\s](\d\d[\s-]?){4}$/, Faker::PhoneNumber.cell_phone_with_country_code)
end
end