diff options
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 |