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

Get rid of broken I18n locales configuration for the tests #2168

Merged
merged 1 commit into from
Oct 20, 2020

Conversation

amatsuda
Copy link
Contributor

Issue#

No-Story

Description:

This patch simply removes four lines of code from test_helper.rb that is currently not working as expected.

Probably since its very first introduction at 9d47686,
the code File.expand_path(File.dirname(__FILE__) + '../lib/locales') seems not to be working
because File.dirname(__FILE__) normally does not end_with a slash (unless we're on UNIX root directory...!)
and so File.dirname(__FILE__) + '../lib/locales') compiles to a broken string that doesn't point to a directory,
then consequently it fails to load any locale file.

And since it doesn't do anything, we could just safely remove this block of code.
The tests shall still pass without this.

This used to set an empty Array to `I18n.available_locales` since
`locales_path` value becomes something like "${faker_dir}/test../lib/locales"
and so no locale files are actually found here.
Copy link
Member

@koic koic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense to me.

@vbrazo vbrazo merged commit a905527 into faker-ruby:master Oct 20, 2020
@amatsuda amatsuda deleted the broken_test_locale_config branch October 20, 2020 17:53
droznyk pushed a commit to droznyk/faker that referenced this pull request Oct 23, 2020
…y#2168)

This used to set an empty Array to `I18n.available_locales` since
`locales_path` value becomes something like "${faker_dir}/test../lib/locales"
and so no locale files are actually found here.
droznyk added a commit to droznyk/faker that referenced this pull request Oct 23, 2020
droznyk added a commit to droznyk/faker that referenced this pull request Oct 23, 2020
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

Successfully merging this pull request may close these issues.

4 participants