[Feature #15408] Fix up _id2ref_spec.rb

This commit is contained in:
Nobuyoshi Nakada 2025-05-10 15:41:30 +09:00
parent 3306d7d2f9
commit c75202c57e
No known key found for this signature in database
GPG Key ID: 3582D74E1FEE4465

View File

@ -1,5 +1,17 @@
require_relative '../../spec_helper'
ruby_version_is "3.5" do
describe "ObjectSpace._id2ref" do
it "is deprecated" do
id = nil.object_id
-> {
ObjectSpace._id2ref(id)
}.should complain(/warning: ObjectSpace\._id2ref is deprecated/)
end
end
end
ruby_version_is ""..."3.5" do
describe "ObjectSpace._id2ref" do
it "converts an object id to a reference to the object" do
s = "I am a string"
@ -50,3 +62,4 @@ describe "ObjectSpace._id2ref" do
proc { ObjectSpace._id2ref(1 << 60) }.should raise_error(RangeError)
end
end
end