summaryrefslogtreecommitdiff
path: root/spec/ruby/core/kernel/srand_spec.rb
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2020-06-27 15:51:37 +0200
committerBenoit Daloze <eregontp@gmail.com>2020-06-27 15:51:37 +0200
commitb3fa158d1c4d8e03b8dc04f1e4f9940a8a4ef44c (patch)
treefa8a62d6192c24a21e70aa02589507adfe4e4e6a /spec/ruby/core/kernel/srand_spec.rb
parent64d8c0815e6ab042e8a67a670bda9f34404fa662 (diff)
Update to ruby/spec@b6b7752
Diffstat (limited to 'spec/ruby/core/kernel/srand_spec.rb')
-rw-r--r--spec/ruby/core/kernel/srand_spec.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/ruby/core/kernel/srand_spec.rb b/spec/ruby/core/kernel/srand_spec.rb
index 5454aae8cf..0985c76cb0 100644
--- a/spec/ruby/core/kernel/srand_spec.rb
+++ b/spec/ruby/core/kernel/srand_spec.rb
@@ -11,6 +11,10 @@ describe "Kernel.srand" do
srand(20).should == 10
end
+ it "returns the previous seed value on the first call" do
+ ruby_exe('p srand(10)', options: '--disable-gems').chomp.should =~ /\A\d+\z/
+ end
+
it "seeds the RNG correctly and repeatably" do
srand(10)
x = rand