aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/core/io/pipe_spec.rb
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2022-08-29 15:36:29 +0200
committerBenoit Daloze <eregontp@gmail.com>2022-08-29 15:36:29 +0200
commit4ee1a687768338a1928014fc6042c320a1a1af3e (patch)
tree37c1717dcd7a2a757e343a41b827fd096397fbca /spec/ruby/core/io/pipe_spec.rb
parenta319d3cfdc1afef8497321fee7f690052b16739c (diff)
downloadruby-4ee1a687768338a1928014fc6042c320a1a1af3e.tar.gz
Update to ruby/spec@d01709f
Diffstat (limited to 'spec/ruby/core/io/pipe_spec.rb')
-rw-r--r--spec/ruby/core/io/pipe_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/ruby/core/io/pipe_spec.rb b/spec/ruby/core/io/pipe_spec.rb
index 2f2cf06f4d..aee0d9003f 100644
--- a/spec/ruby/core/io/pipe_spec.rb
+++ b/spec/ruby/core/io/pipe_spec.rb
@@ -25,6 +25,17 @@ describe "IO.pipe" do
@r.should be_an_instance_of(IOSpecs::SubIO)
@w.should be_an_instance_of(IOSpecs::SubIO)
end
+
+ it "does not use IO.new method to create pipes and allows its overriding" do
+ ScratchPad.record []
+
+ # so redefined .new is not called, but original #initialize is
+ @r, @w = IOSpecs::SubIOWithRedefinedNew.pipe
+ ScratchPad.recorded.should == [:call_original_initialize, :call_original_initialize] # called 2 times - for each pipe (r and w)
+
+ @r.should be_an_instance_of(IOSpecs::SubIOWithRedefinedNew)
+ @w.should be_an_instance_of(IOSpecs::SubIOWithRedefinedNew)
+ end
end
describe "IO.pipe" do