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

Create Faker dsl for easier configuration #71

Merged
merged 1 commit into from
May 16, 2021
Merged

Create Faker dsl for easier configuration #71

merged 1 commit into from
May 16, 2021

Conversation

johanvergeer
Copy link
Contributor

I've created a DSL to create Faker instances.

So instead of having to do something like this:

val fakerConfig = FakerConfig.builder().create {
    random = Random(42)
}

val faker = Faker(fakerConfig)

We can now do this:

val faker = faker {
    config {
        random = Random()
        locale = "nl"
        uniqueGeneratorRetryLimit = 111
    }
}

A bit more concise and the Kotlin way.

Copy link
Owner

@serpro69 serpro69 left a comment

Choose a reason for hiding this comment

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

This looks great. Thanks.

@serpro69 serpro69 merged commit 499a61e into serpro69:master May 16, 2021
@serpro69 serpro69 added this to the 1.8.0 milestone May 17, 2021
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.

2 participants