diff options
author | John Hawthorn <[email protected]> | 2024-11-26 16:40:47 -0800 |
---|---|---|
committer | John Hawthorn <[email protected]> | 2024-11-29 20:41:00 -0800 |
commit | f1dda5ed011b79d0d7bd31b09b55b5e19d8abd0c (patch) | |
tree | c041fbb7590bbb9414aab605e00d0c6e570946c8 /spec/ruby/core | |
parent | a505cd32fb55aec0423c5b57d17ae31c076b44ab (diff) |
Warn when redefining __id__ as well as object_id
[Feature #20912]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/12177
Diffstat (limited to 'spec/ruby/core')
-rw-r--r-- | spec/ruby/core/basicobject/equal_spec.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/spec/ruby/core/basicobject/equal_spec.rb b/spec/ruby/core/basicobject/equal_spec.rb index 3c1ad56d4a..ce28eaed95 100644 --- a/spec/ruby/core/basicobject/equal_spec.rb +++ b/spec/ruby/core/basicobject/equal_spec.rb @@ -11,8 +11,10 @@ describe "BasicObject#equal?" do it "is unaffected by overriding __id__" do o1 = mock("object") o2 = mock("object") - def o1.__id__; 10; end - def o2.__id__; 10; end + suppress_warning { + def o1.__id__; 10; end + def o2.__id__; 10; end + } o1.equal?(o2).should be_false end |