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

Add note about Random behavior on MiniTest #2579

Merged

Conversation

stefannibrasil
Copy link
Contributor

Add a note For MiniTest users.

To prevent duplicated values when generating random values in different test files, add Faker::Config.random = Random.new
to test_helper or rails_helper.

Fixes Issue #2534

Ruby 3 deprecated `Random::DEFAULT`. Faker 2.22 started
calling `Random` directly. For MiniTest users,
to prevent duplicated values when generating
random values in different test files,
add `Faker::Config.random = Random.new`
to `test_helper` or `rails_helper`.
@Zeragamba
Copy link
Contributor

LGTM

@stefannibrasil stefannibrasil deleted the add-note-about-duplicated-values branch October 5, 2022 14:06
sudeeptarlekar pushed a commit to sudeeptarlekar/faker that referenced this pull request Oct 7, 2022
Ruby 3 deprecated `Random::DEFAULT`. Faker 2.22 started
calling `Random` directly. For MiniTest users,
to prevent duplicated values when generating
random values in different test files,
add `Faker::Config.random = Random.new`
to `test_helper` or `rails_helper`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Backwards Breaking change 2.22] Faker is reliably generating duplicate values
2 participants