summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2020-12-14 20:24:18 +0100
committerBenoit Daloze <eregontp@gmail.com>2020-12-14 20:29:50 +0100
commitf5c89c1660afd3a89514125aad579c0a96990c4b (patch)
tree119a4e2441a87c9d70870c0d5ad97e8f00f7869f /spec
parentc183288754fdad17e627c4182de599d965e99405 (diff)
Deprecate Random::DEFAULT
* Closes [Feature #17351].
Diffstat (limited to 'spec')
-rw-r--r--spec/ruby/core/random/default_spec.rb18
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