1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Update rubyspec for stringio bug fix

This commit is contained in:
Jeremy Evans 2022-05-29 21:25:05 -07:00
parent 609d73e892
commit 12e34a4276

View file

@ -36,12 +36,23 @@ describe :stringio_each_separator, shared: true do
seen.should == ["2 1 2 1 2"] seen.should == ["2 1 2 1 2"]
end end
it "yields each paragraph when passed an empty String as separator" do ruby_version_is ''..."3.2" do
it "yields each paragraph with two separation characters when passed an empty String as separator" do
seen = [] seen = []
io = StringIO.new("para1\n\npara2\n\n\npara3") io = StringIO.new("para1\n\npara2\n\n\npara3")
io.send(@method, "") {|s| seen << s} io.send(@method, "") {|s| seen << s}
seen.should == ["para1\n\n", "para2\n\n", "para3"] seen.should == ["para1\n\n", "para2\n\n", "para3"]
end end
end
ruby_version_is "3.2" do
it "yields each paragraph with all separation characters when passed an empty String as separator" do
seen = []
io = StringIO.new("para1\n\npara2\n\n\npara3")
io.send(@method, "") {|s| seen << s}
seen.should == ["para1\n\n", "para2\n\n\n", "para3"]
end
end
end end
describe :stringio_each_no_arguments, shared: true do describe :stringio_each_no_arguments, shared: true do