Skip to content

Commit

Permalink
Remove tzinfo dependency (#2952)
Browse files Browse the repository at this point in the history
faker unfortunately can't be relying on gems for
validating random generated data for every generator
we have. That introduces too much work for maintainers.

Having one dependency for tests means opening the doors for more
dependencies later on. Although we do our best to keep the library
up to date, we can't keep up with all the validations to be passing.

If users rely on valid Timezones for their apps, we recommend not
relying on faker for that and instead ensure valid data is generated
on their end.
  • Loading branch information
Stefanni Brasil authored May 9, 2024
1 parent fad7ac4 commit 6595da9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ 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'
8 changes: 0 additions & 8 deletions test/test_en_locale.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: true

require 'tzinfo'
require_relative 'test_helper'

class TestEnLocale < Test::Unit::TestCase
Expand Down Expand Up @@ -40,13 +39,6 @@ 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

0 comments on commit 6595da9

Please sign in to comment.