diff options
Diffstat (limited to 'spec/ruby/core/kernel/fixtures/classes.rb')
-rw-r--r-- | spec/ruby/core/kernel/fixtures/classes.rb | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/spec/ruby/core/kernel/fixtures/classes.rb b/spec/ruby/core/kernel/fixtures/classes.rb index 1bf5715c50..541a4c075e 100644 --- a/spec/ruby/core/kernel/fixtures/classes.rb +++ b/spec/ruby/core/kernel/fixtures/classes.rb @@ -281,14 +281,25 @@ module KernelSpecs @two = two end - def initialize_copy(other) + def initialize_copy(other, **kw) ScratchPad.record object_id end + + # define to support calling #clone with optional :freeze keyword argument + def initialize_clone(other, **kw) + super(other) # to call #initialize_copy + end end class Clone def initialize_clone(other) - ScratchPad.record other.object_id + ScratchPad.record other + end + end + + class CloneFreeze + def initialize_clone(other, **kwargs) + ScratchPad.record([other, kwargs]) end end |