summaryrefslogtreecommitdiff
path: root/spec/ruby/core/io/shared/each.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/io/shared/each.rb')
-rw-r--r--spec/ruby/core/io/shared/each.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/ruby/core/io/shared/each.rb b/spec/ruby/core/io/shared/each.rb
index dc07434ecd..d87303b54a 100644
--- a/spec/ruby/core/io/shared/each.rb
+++ b/spec/ruby/core/io/shared/each.rb
@@ -114,6 +114,15 @@ describe :io_each, shared: true do
ScratchPad.recorded.should == IOSpecs.paragraphs
end
end
+
+ ruby_version_is "2.4" do
+ describe "when passed chomp" do
+ it "yields each line without trailing newline characters to the passed block" do
+ @io.send(@method, chomp: true) { |s| ScratchPad << s }
+ ScratchPad.recorded.should == IOSpecs.lines_without_newline_characters
+ end
+ end
+ end
end
describe :io_each_default_separator, shared: true do