You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, this is incorrect, and it breaks any test suite which expects reproducible results by seeding the global RNG when a seed argument is used.
The fix is to use Random (the class) instead of Random.new, as this is the new place where the 'global' RNG lives (and indeed Random::DEFAULT refers to Random in Ruby 3).
The merged PR #2225 replaced
Random::DEFAULT
(which is deprecated in Ruby 3) withRandom.new
.faker/lib/faker.rb
Line 32 in b78a47e
See #2225 (comment)
However, this is incorrect, and it breaks any test suite which expects reproducible results by seeding the global RNG when a seed argument is used.
The fix is to use
Random
(the class) instead ofRandom.new
, as this is the new place where the 'global' RNG lives (and indeedRandom::DEFAULT
refers toRandom
in Ruby 3).See the two bullet points under 'Random' in the Ruby 3.0.0 release notes for more info.
The text was updated successfully, but these errors were encountered: