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

Faker::Internet.domain_word == "" #956

Closed
polyglot0027 opened this issue Jun 21, 2017 · 9 comments
Closed

Faker::Internet.domain_word == "" #956

polyglot0027 opened this issue Jun 21, 2017 · 9 comments

Comments

@polyglot0027
Copy link

This method return a void string, i.e "".

@SagareGanesh
Copy link
Contributor

@polyglot0027 which faker version you are using?

@polyglot0027
Copy link
Author

@SagareGanesh faker (1.7.3)

@SagareGanesh
Copy link
Contributor

@polyglot0027 I don't think there is such issue, I have tried to reproduce it locally, but didn't get anything.
Below is my testing report.
issue1

could you please add your screenshot here, so it ll help to reproduce it.

@polyglot0027
Copy link
Author

Sure! :)
screen shot 2017-06-21 at 22 46 33

@SagareGanesh
Copy link
Contributor

@polyglot0027 This is weird issue. Because domain_name method internally uses domain_word method to create domain name, and add suffix(i.e .com, .org etc) to it.
Logically if domain_word method returns empty string, then the domain_name should return ".com" or ".org"


If your domain_name method is working, you can use
Faker::Internet.domain_name.split('.')[0]
for domain word

@polyglot0027
Copy link
Author

@SagareGanesh The issue occurs because of localization settings:
screen shot 2017-06-22 at 10 12 01

@SagareGanesh
Copy link
Contributor

@polyglot0027 You are right, got the issue. The reason behind the domain_name method working for any locale and domain_word not, is domain_name always returns domain name with en locale. I have resolved this issue and created PR.

@polyglot0027
Copy link
Author

@SagareGanesh Cool! Thanks

@stympy
Copy link
Contributor

stympy commented Jul 10, 2017

Closed by #957

@stympy stympy closed this as completed Jul 10, 2017
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

No branches or pull requests

3 participants