diff options
author | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-28 15:15:48 +0000 |
---|---|---|
committer | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-28 15:15:48 +0000 |
commit | b1343dbf10de8bc1f20bf153773a548bcf80e239 (patch) | |
tree | 7905b284cb5b3d62c17ad8a939e339621a498a2c /spec/ruby/library/stringio/gets_spec.rb | |
parent | 5a0339e2cae1f979fb2b39852c4779f2282ecf4f (diff) | |
download | ruby-b1343dbf10de8bc1f20bf153773a548bcf80e239.tar.gz |
Update to ruby/spec@a6b8805
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/ruby/library/stringio/gets_spec.rb')
-rw-r--r-- | spec/ruby/library/stringio/gets_spec.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/spec/ruby/library/stringio/gets_spec.rb b/spec/ruby/library/stringio/gets_spec.rb index 307f564a6e..f94448688b 100644 --- a/spec/ruby/library/stringio/gets_spec.rb +++ b/spec/ruby/library/stringio/gets_spec.rb @@ -6,7 +6,7 @@ describe "StringIO#gets when passed [separator]" do @io = StringIO.new("this>is>an>example") end - it "returns the data read till the next occurence of the passed separator" do + it "returns the data read till the next occurrence of the passed separator" do @io.gets(">").should == "this>" @io.gets(">").should == "is>" @io.gets(">").should == "an>" @@ -72,7 +72,7 @@ describe "StringIO#gets when passed no argument" do @io = StringIO.new("this is\nan example\nfor StringIO#gets") end - it "returns the data read till the next occurence of $/ or till eof" do + it "returns the data read till the next occurrence of $/ or till eof" do @io.gets.should == "this is\n" begin @@ -236,3 +236,12 @@ describe "StringIO#gets when in write-only mode" do lambda { io.gets }.should raise_error(IOError) end end + +ruby_version_is "2.4" do + describe "StringIO#gets when passed [chomp]" do + it "returns the data read without a trailing newline character" do + io = StringIO.new("this>is>an>example\n") + io.gets(chomp: true).should == "this>is>an>example" + end + end +end
\ No newline at end of file |