aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/library/stringio/readlines_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/library/stringio/readlines_spec.rb')
-rw-r--r--spec/ruby/library/stringio/readlines_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/ruby/library/stringio/readlines_spec.rb b/spec/ruby/library/stringio/readlines_spec.rb
index 215a6cbb2a..11217d1e59 100644
--- a/spec/ruby/library/stringio/readlines_spec.rb
+++ b/spec/ruby/library/stringio/readlines_spec.rb
@@ -90,3 +90,12 @@ describe "StringIO#readlines when in write-only mode" do
lambda { io.readlines }.should raise_error(IOError)
end
end
+
+ruby_version_is "2.4" do
+ describe "StringIO#readlines when passed [chomp]" do
+ it "returns the data read without a trailing newline character" do
+ io = StringIO.new("this>is\nan>example\r\n")
+ io.readlines(chomp: true).should == ["this>is", "an>example"]
+ end
+ end
+end