mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Remove unnecessary Random::DEFAULT expectations
The respond_to expectation just suffice as duck-typing.
This commit is contained in:
parent
789da481fc
commit
84891bffe8
Notes:
git
2022-01-01 18:56:12 +09:00
1 changed files with 0 additions and 22 deletions
|
@ -7,28 +7,6 @@ describe "Random::DEFAULT" do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
ruby_version_is ''...'3.0' do
|
|
||||||
it "returns a Random instance" do
|
|
||||||
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
|
|
||||||
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
|
|
||||||
|
|
||||||
it "changes seed on reboot" do
|
it "changes seed on reboot" do
|
||||||
seed1 = ruby_exe('p Random::DEFAULT.seed', options: '--disable-gems')
|
seed1 = ruby_exe('p Random::DEFAULT.seed', options: '--disable-gems')
|
||||||
seed2 = ruby_exe('p Random::DEFAULT.seed', options: '--disable-gems')
|
seed2 = ruby_exe('p Random::DEFAULT.seed', options: '--disable-gems')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue