summaryrefslogtreecommitdiff
path: root/spec/ruby/core/io
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2025-10-08 17:59:52 +0200
committerBenoit Daloze <eregontp@gmail.com>2025-10-08 17:59:52 +0200
commit50593d51997eab4aa5a148c5e131d10ea535f955 (patch)
treed284c028a5679843878f63eeb4fbb3f6525fdb4e /spec/ruby/core/io
parent5e7e6040938a37d1c320d69d2266f1b39e1b9f2a (diff)
Update to ruby/spec@3d7e563
Diffstat (limited to 'spec/ruby/core/io')
-rw-r--r--spec/ruby/core/io/readpartial_spec.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/ruby/core/io/readpartial_spec.rb b/spec/ruby/core/io/readpartial_spec.rb
index 2fcfaf5203..176c33cf9e 100644
--- a/spec/ruby/core/io/readpartial_spec.rb
+++ b/spec/ruby/core/io/readpartial_spec.rb
@@ -93,6 +93,11 @@ describe "IO#readpartial" do
@rd.readpartial(0).should == ""
end
+ it "raises IOError if the stream is closed and the length argument is 0" do
+ @rd.close
+ -> { @rd.readpartial(0) }.should raise_error(IOError, "closed stream")
+ end
+
it "clears and returns the given buffer if the length argument is 0" do
buffer = +"existing content"
@rd.readpartial(0, buffer).should == buffer