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

Fix invalid IANA time zone identifier for Atlantic/Cape_Verde #2927

Merged
merged 2 commits into from
Apr 19, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ gem 'rubocop-rake', '0.6.0'
gem 'simplecov', '0.22.0'
gem 'test-unit', '3.6.2'
gem 'timecop', '0.9.8'
gem 'tzinfo', '2.0.6'
gem 'yard', '0.9.36'
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ GEM
test-unit (3.6.2)
power_assert
timecop (0.9.8)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.5.0)
yard (0.9.36)

Expand All @@ -78,6 +80,7 @@ DEPENDENCIES
simplecov (= 0.22.0)
test-unit (= 3.6.2)
timecop (= 0.9.8)
tzinfo (= 2.0.6)
yard (= 0.9.36)

BUNDLED WITH
Expand Down
2 changes: 1 addition & 1 deletion lib/locales/en/address.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1717,7 +1717,7 @@ en:
- America/Godthab
- Atlantic/South_Georgia
- Atlantic/Azores
- Atlantic/Cabo_Verde
- Atlantic/Cape_Verde
- Europe/Dublin
- Europe/London
- Europe/Lisbon
Expand Down
8 changes: 8 additions & 0 deletions test/test_en_locale.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# frozen_string_literal: true

require 'tzinfo'
require_relative 'test_helper'

class TestEnLocale < Test::Unit::TestCase
Expand Down Expand Up @@ -39,6 +40,13 @@ def test_values_trimmed
check_hash(en_file)
end

def test_en_timezones_are_valid_iana_identifiers
faker_time_zones = Faker::Address.translate('faker.address.time_zone')
iana_time_zones = TZInfo::Timezone.all_identifiers

assert_empty(faker_time_zones.difference(iana_time_zones), "Found a time zone that isn't a valid IANA time zone identifier")
end

def check_hash(hash)
hash.each { |key, value| check_value(value) unless key == 'separator' }
end
Expand Down
Loading