Skip to content

Add note about Random behavior on MiniTest#2579

Merged
Zeragamba merged 1 commit intofaker-ruby:mainfrom
hexdevs:add-note-about-duplicated-values
Oct 5, 2022
Merged

Add note about Random behavior on MiniTest#2579
Zeragamba merged 1 commit intofaker-ruby:mainfrom
hexdevs:add-note-about-duplicated-values

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

3 participants