diff options
Diffstat (limited to 'spec/ruby/core/random')
| -rw-r--r-- | spec/ruby/core/random/bytes_spec.rb | 2 | ||||
| -rw-r--r-- | spec/ruby/core/random/default_spec.rb | 32 | ||||
| -rw-r--r-- | spec/ruby/core/random/new_spec.rb | 2 |
3 files changed, 4 insertions, 32 deletions
diff --git a/spec/ruby/core/random/bytes_spec.rb b/spec/ruby/core/random/bytes_spec.rb index b42dc61234..c9be07cd3f 100644 --- a/spec/ruby/core/random/bytes_spec.rb +++ b/spec/ruby/core/random/bytes_spec.rb @@ -1,4 +1,4 @@ -# -*- encoding: binary -*- +# encoding: binary require_relative '../../spec_helper' require_relative 'shared/bytes' diff --git a/spec/ruby/core/random/default_spec.rb b/spec/ruby/core/random/default_spec.rb index 01d7430df8..9e4845986d 100644 --- a/spec/ruby/core/random/default_spec.rb +++ b/spec/ruby/core/random/default_spec.rb @@ -1,35 +1,7 @@ require_relative '../../spec_helper' describe "Random::DEFAULT" do - ruby_version_is ''...'3.2' do - it "returns a random number generator" do - suppress_warning do - Random::DEFAULT.should respond_to(:rand) - end - end - - it "changes seed on reboot" do - seed1 = ruby_exe('p Random::DEFAULT.seed', options: '--disable-gems') - seed2 = ruby_exe('p Random::DEFAULT.seed', options: '--disable-gems') - seed1.should != seed2 - end - - it "refers to the Random class" do - suppress_warning do - Random::DEFAULT.should.equal?(Random) - end - end - - it "is deprecated" do - -> { - Random::DEFAULT.should.equal?(Random) - }.should complain(/constant Random::DEFAULT is deprecated/) - end - end - - ruby_version_is '3.2' do - it "is no longer defined" do - Random.should_not.const_defined?(:DEFAULT) - end + it "is no longer defined" do + Random.should_not.const_defined?(:DEFAULT) end end diff --git a/spec/ruby/core/random/new_spec.rb b/spec/ruby/core/random/new_spec.rb index 90e2a9d6f2..69210cef03 100644 --- a/spec/ruby/core/random/new_spec.rb +++ b/spec/ruby/core/random/new_spec.rb @@ -11,7 +11,7 @@ describe "Random.new" do it "returns Random instances initialized with different seeds" do first = Random.new second = Random.new - (0..20).map { first.rand } .should_not == (0..20).map { second.rand } + (0..20).map { first.rand }.should_not == (0..20).map { second.rand } end it "accepts an Integer seed value as an argument" do |
