diff options
Diffstat (limited to 'spec/ruby/core/io/fixtures/classes.rb')
-rw-r--r-- | spec/ruby/core/io/fixtures/classes.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/ruby/core/io/fixtures/classes.rb b/spec/ruby/core/io/fixtures/classes.rb index 067ab59d93..204a2a101b 100644 --- a/spec/ruby/core/io/fixtures/classes.rb +++ b/spec/ruby/core/io/fixtures/classes.rb @@ -7,6 +7,18 @@ module IOSpecs class SubIO < IO end + class SubIOWithRedefinedNew < IO + def self.new(...) + ScratchPad << :redefined_new_called + super + end + + def initialize(...) + ScratchPad << :call_original_initialize + super + end + end + def self.collector Proc.new { |x| ScratchPad << x } end |