1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Moved Array#shuffle and Array#shuffle! to rbinc

This commit is contained in:
Nobuyoshi Nakada 2020-01-26 18:27:40 +09:00
parent 0aa5195262
commit 29eb1b1602
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60
5 changed files with 53 additions and 54 deletions

View file

@ -25,10 +25,13 @@ describe "Array#shuffle" do
ArraySpecs::MyArray[1, 2, 3].shuffle.should be_an_instance_of(Array)
end
it "attempts coercion via #to_hash" do
obj = mock('hash')
obj.should_receive(:to_hash).once.and_return({})
[2, 3].shuffle(obj)
ruby_version_is ""..."2.8" do
# keyword argument since 2.8
it "attempts coercion via #to_hash" do
obj = mock('hash')
obj.should_receive(:to_hash).once.and_return({})
[2, 3].shuffle(obj)
end
end
it "calls #rand on the Object passed by the :random key in the arguments Hash" do