summaryrefslogtreecommitdiff
path: root/test/ruby/test_object.rb
diff options
context:
space:
mode:
authorJohn Hawthorn <[email protected]>2024-11-26 16:40:47 -0800
committerJohn Hawthorn <[email protected]>2024-11-29 20:41:00 -0800
commitf1dda5ed011b79d0d7bd31b09b55b5e19d8abd0c (patch)
treec041fbb7590bbb9414aab605e00d0c6e570946c8 /test/ruby/test_object.rb
parenta505cd32fb55aec0423c5b57d17ae31c076b44ab (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 'test/ruby/test_object.rb')
-rw-r--r--test/ruby/test_object.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/ruby/test_object.rb b/test/ruby/test_object.rb
index 3afad0ef43..7d00422629 100644
--- a/test/ruby/test_object.rb
+++ b/test/ruby/test_object.rb
@@ -480,7 +480,7 @@ class TestObject < Test::Unit::TestCase
end
def test_redefine_method_which_may_case_serious_problem
- %w(object_id __send__).each do |m|
+ %w(object_id __id__ __send__).each do |m|
assert_in_out_err([], <<-INPUT, [], %r"warning: redefining '#{m}' may cause serious problems$")
$VERBOSE = false
def (Object.new).#{m}; end
@@ -542,7 +542,7 @@ class TestObject < Test::Unit::TestCase
bug2202 = '[ruby-core:26074]'
assert_raise(NoMethodError, bug2202) {o2.meth2}
- %w(object_id __send__ initialize).each do |m|
+ %w(object_id __id__ __send__ initialize).each do |m|
assert_in_out_err([], <<-INPUT, %w(:ok), %r"warning: removing '#{m}' may cause serious problems$")
$VERBOSE = false
begin