summaryrefslogtreecommitdiff
path: root/spec/ruby/core
diff options
context:
space:
mode:
authorTema Bolshakov <either.free@gmail.com>2023-11-28 13:35:38 +0100
committerYusuke Endoh <mame@ruby-lang.org>2023-11-29 09:39:15 +0900
commitbed014e374c6a4a7cec15a18e9dd702b674706d9 (patch)
tree29e7ff571b5ef34855c1ff492db359ac85c2c62d /spec/ruby/core
parent9c900771daa5e44d3be0d3c1d1e53e76763cfabb (diff)
Do not call the inplicit convercion spec on older ruby versions
Diffstat (limited to 'spec/ruby/core')
-rw-r--r--spec/ruby/core/array/rassoc_spec.rb22
1 files changed, 12 insertions, 10 deletions
diff --git a/spec/ruby/core/array/rassoc_spec.rb b/spec/ruby/core/array/rassoc_spec.rb
index a7ffb75fb5..632a05e8b3 100644
--- a/spec/ruby/core/array/rassoc_spec.rb
+++ b/spec/ruby/core/array/rassoc_spec.rb
@@ -36,15 +36,17 @@ describe "Array#rassoc" do
[[1, :foobar, o], [2, o, 1], [3, mock('foo')]].rassoc(key).should == [2, o, 1]
end
- it "calls to_ary on non-array elements" do
- s1 = [1, 2]
- s2 = ArraySpecs::ArrayConvertible.new(2, 3)
- a = [s1, s2]
-
- s1.should_not_receive(:to_ary)
- a.rassoc(2).should equal(s1)
-
- a.rassoc(3).should == [2, 3]
- s2.called.should equal(:to_ary)
+ ruby_version_is "3.3" do
+ it "calls to_ary on non-array elements" do
+ s1 = [1, 2]
+ s2 = ArraySpecs::ArrayConvertible.new(2, 3)
+ a = [s1, s2]
+
+ s1.should_not_receive(:to_ary)
+ a.rassoc(2).should equal(s1)
+
+ a.rassoc(3).should == [2, 3]
+ s2.called.should equal(:to_ary)
+ end
end
end