summaryrefslogtreecommitdiff
path: root/spec/ruby/core/io/shared/readlines.rb
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2022-03-28 17:47:04 +0200
committerBenoit Daloze <eregontp@gmail.com>2022-03-28 17:47:04 +0200
commit8db4f25bf4327f169902afd9ea8f4b03b65656f0 (patch)
treead61b99fb2d5ebfe9c07de8c2b5885e80d20b8e1 /spec/ruby/core/io/shared/readlines.rb
parentae650f0372e10cea4d695769b1fcdc23a76fdf17 (diff)
Update to ruby/spec@aaf998f
Diffstat (limited to 'spec/ruby/core/io/shared/readlines.rb')
-rw-r--r--spec/ruby/core/io/shared/readlines.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/ruby/core/io/shared/readlines.rb b/spec/ruby/core/io/shared/readlines.rb
index 8e4a73bb98..52b20364ef 100644
--- a/spec/ruby/core/io/shared/readlines.rb
+++ b/spec/ruby/core/io/shared/readlines.rb
@@ -73,6 +73,11 @@ describe :io_readlines_options_19, shared: true do
result = IO.send(@method, @name, 10, &@object)
(result ? result : ScratchPad.recorded).should == IOSpecs.lines_limit
end
+
+ it "ignores the object as a limit if it is negative" do
+ result = IO.send(@method, @name, -2, &@object)
+ (result ? result : ScratchPad.recorded).should == IOSpecs.lines
+ end
end
describe "when the object is a String" do