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:
parent
0aa5195262
commit
29eb1b1602
5 changed files with 53 additions and 54 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue