[前][次][番号順一覧][スレッド一覧]

ruby-changes:70258

From: Nobuyoshi <ko1@a...>
Date: Thu, 16 Dec 2021 17:44:29 +0900 (JST)
Subject: [ruby-changes:70258] 32ee6f80ee (master): Restore the global random seed

https://git.ruby-lang.org/ruby.git/commit/?id=32ee6f80ee

From 32ee6f80ee1737699ead57bf577f0b1b90c2523e Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Thu, 16 Dec 2021 16:01:06 +0900
Subject: Restore the global random seed

---
 spec/ruby/core/kernel/srand_spec.rb | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/spec/ruby/core/kernel/srand_spec.rb b/spec/ruby/core/kernel/srand_spec.rb
index 39c78b4ffee..95bb406f464 100644
--- a/spec/ruby/core/kernel/srand_spec.rb
+++ b/spec/ruby/core/kernel/srand_spec.rb
@@ -2,6 +2,14 @@ require_relative '../../spec_helper' https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/kernel/srand_spec.rb#L2
 require_relative 'fixtures/classes'
 
 describe "Kernel#srand" do
+  before :each do
+    @seed = srand
+  end
+
+  after :each do
+    srand(@seed)
+  end
+
   it "is a private method" do
     Kernel.should have_private_instance_method(:srand)
   end
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]