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

Calling internet.freeEmail() returns domain instead of an email address #12

Closed
jershell opened this issue Oct 27, 2019 · 6 comments
Closed
Labels
enhancement 🚀 New feature or request

Comments

@jershell
Copy link

How to get an email address?

In original, I could

Faker::Internet.email #=> "kirsten.greenholt@corkeryfisher.info"
@serpro69
Copy link
Owner

Hi,
If you're using kotlin: Faker.internet.freeEmail()

See also https://github.com/serpro69/kotlin-faker#data-providers for a list of all providers and their functions.

@jershell
Copy link
Author

jershell commented Oct 30, 2019

Faker.internet.freeEmail() return hotmail.com that not a valid email address. It looks like a bug.
If it`s correct behavior maybe we can rename it to emailDomain()?

@serpro69
Copy link
Owner

serpro69 commented Oct 30, 2019

Sorry, I replied by memory.

You are correct. If you look at the internet.yml dictionary file you'll see that free email returns one of the three domains:

  free_email: [gmail.com, yahoo.com, hotmail.com]

And the docs that I mentioned in the comment above are actually saying the same.

I haven't gotten as far as implementing anything outside of what is there in the yml dictionary files. But you're right, this should be added to the internet provider.

As far as renaming the function, again I tried to stay close to what is in the yml files, but I will think about it. It kind of makes sense.

@serpro69 serpro69 added the bug 🐞 Something isn't working label Oct 30, 2019
@serpro69 serpro69 changed the title [Q]How to get an email address? Calling internet.freeEmail() returns domain instead of an email address Oct 30, 2019
@serpro69
Copy link
Owner

Will fix this over the weekend and add to next release.

@serpro69 serpro69 added enhancement 🚀 New feature or request and removed bug 🐞 Something isn't working labels Oct 30, 2019
@serpro69
Copy link
Owner

This is added to version 1.0.
See usage here: https://github.com/serpro69/kotlin-faker/blob/master/doc/internet.md

@jershell
Copy link
Author

it's great. Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 🚀 New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants