diff options
author | Benoit Daloze <[email protected]> | 2020-12-14 20:24:18 +0100 |
---|---|---|
committer | Benoit Daloze <[email protected]> | 2020-12-14 20:29:50 +0100 |
commit | f5c89c1660afd3a89514125aad579c0a96990c4b (patch) | |
tree | 119a4e2441a87c9d70870c0d5ad97e8f00f7869f /spec | |
parent | c183288754fdad17e627c4182de599d965e99405 (diff) |
Deprecate Random::DEFAULT
* Closes [Feature #17351].
Diffstat (limited to 'spec')
-rw-r--r-- | spec/ruby/core/random/default_spec.rb | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/spec/ruby/core/random/default_spec.rb b/spec/ruby/core/random/default_spec.rb index 014cc378a9..a709eddd53 100644 --- a/spec/ruby/core/random/default_spec.rb +++ b/spec/ruby/core/random/default_spec.rb @@ -3,18 +3,30 @@ require_relative '../../spec_helper' describe "Random::DEFAULT" do it "returns a random number generator" do - Random::DEFAULT.should respond_to(:rand) + suppress_warning do + Random::DEFAULT.should respond_to(:rand) + end end ruby_version_is ''...'3.0' do it "returns a Random instance" do - Random::DEFAULT.should be_an_instance_of(Random) + suppress_warning do + Random::DEFAULT.should be_an_instance_of(Random) + end end end ruby_version_is '3.0' do it "refers to the Random class" do - Random::DEFAULT.should.equal?(Random) + 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 |