ruby-changes:72011
From: Jeremy <ko1@a...>
Date: Mon, 30 May 2022 13:25:48 +0900 (JST)
Subject: [ruby-changes:72011] 12e34a4276 (master): Update rubyspec for stringio bug fix
https://git.ruby-lang.org/ruby.git/commit/?id=12e34a4276 From 12e34a42769780ff9bda98c6a5db1ce621389915 Mon Sep 17 00:00:00 2001 From: Jeremy Evans <code@j...> Date: Sun, 29 May 2022 21:25:05 -0700 Subject: Update rubyspec for stringio bug fix --- spec/ruby/library/stringio/shared/each.rb | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/spec/ruby/library/stringio/shared/each.rb b/spec/ruby/library/stringio/shared/each.rb index 14b0a013b3..3be6661ce5 100644 --- a/spec/ruby/library/stringio/shared/each.rb +++ b/spec/ruby/library/stringio/shared/each.rb @@ -36,11 +36,22 @@ describe :stringio_each_separator, shared: true do https://github.com/ruby/ruby/blob/trunk/spec/ruby/library/stringio/shared/each.rb#L36 seen.should == ["2 1 2 1 2"] end - it "yields each paragraph 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", "para3"] + ruby_version_is ''..."3.2" do + it "yields each paragraph with two 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", "para3"] + 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 -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/