aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-01-26 18:27:40 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-01-26 19:40:34 +0900
commit29eb1b16028928139dcaa236beb6d351c85f434c (patch)
tree43a8ae1aa238767d4bf5443e47bafe1f1bc31cea /spec
parent0aa5195262d4193d3accf3e6b9bad236238b816b (diff)
downloadruby-29eb1b16028928139dcaa236beb6d351c85f434c.tar.gz
Moved Array#shuffle and Array#shuffle! to rbinc
Diffstat (limited to 'spec')
-rw-r--r--spec/ruby/core/array/shuffle_spec.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/spec/ruby/core/array/shuffle_spec.rb b/spec/ruby/core/array/shuffle_spec.rb
index 7a2fed7d50..106ef05ce2 100644
--- a/spec/ruby/core/array/shuffle_spec.rb
+++ b/spec/ruby/core/array/shuffle_spec.rb
@@ -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