mirror of
https://github.com/ruby/ruby.git
synced 2026-01-27 04:24:23 +00:00
Change test to define ivars in initialize method
Defining ivars in initialize method guarantees the object to be embedded.
This commit is contained in:
parent
5808727851
commit
f42535fa38
Notes:
git
2025-12-20 23:15:18 +00:00
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user