From 8c5b60eb22d6d661e87992a65d54e3a5bc0aeed4 Mon Sep 17 00:00:00 2001 From: eregon Date: Sat, 28 Oct 2017 15:15:48 +0000 Subject: Update to ruby/spec@a6b8805 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- spec/ruby/library/stringio/shared/each.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'spec/ruby/library/stringio/shared') diff --git a/spec/ruby/library/stringio/shared/each.rb b/spec/ruby/library/stringio/shared/each.rb index 0fde23634e..55ed27c1c7 100644 --- a/spec/ruby/library/stringio/shared/each.rb +++ b/spec/ruby/library/stringio/shared/each.rb @@ -103,3 +103,12 @@ describe :stringio_each_not_readable, shared: true do lambda { io.send(@method) { |b| b } }.should raise_error(IOError) end end + +describe :stringio_each_chomp, shared: true do + it "yields each line with removed newline characters to the passed block" do + seen = [] + io = StringIO.new("a b \rc d e\n1 2 3 4 5\r\nthe end") + io.send(@method, chomp: true) {|s| seen << s } + seen.should == ["a b \rc d e", "1 2 3 4 5", "the end"] + end +end -- cgit v1.2.3