Change test to define ivars in initialize method

Defining ivars in initialize method guarantees the object to be embedded.
This commit is contained in:
Peter Zhu 2025-12-20 16:33:21 -05:00
parent 5808727851
commit f42535fa38
Notes: git 2025-12-20 23:15:18 +00:00

View File

@ -359,11 +359,13 @@ class TestObject < Test::Unit::TestCase
require "objspace"
c = Class.new do
def a = @a
attr_reader :a, :b, :c
def b = @b
def c = @c
def initialize
@a = nil
@b = nil
@c = nil
end
end
o1 = c.new