diff options
author | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-02-21 15:38:59 +0000 |
---|---|---|
committer | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-02-21 15:38:59 +0000 |
commit | da7976235fbc2986925969646071bebe3702e49f (patch) | |
tree | 83bbf6a8e03cf990369feabe6c1c9d45c69f4c85 /spec/ruby/library/stringio | |
parent | b8e389a0f3226c90e96e02e6396686a3bef6a456 (diff) |
Update to ruby/spec@7a16e01
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/ruby/library/stringio')
-rw-r--r-- | spec/ruby/library/stringio/puts_spec.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/ruby/library/stringio/puts_spec.rb b/spec/ruby/library/stringio/puts_spec.rb index 396d9f25f4..152bfb13f8 100644 --- a/spec/ruby/library/stringio/puts_spec.rb +++ b/spec/ruby/library/stringio/puts_spec.rb @@ -51,6 +51,14 @@ describe "StringIO#puts when passed an Array" do @io.puts([obj]) @io.string.should == "to_s\n" end + + it "returns general object info if :to_s does not return a string" do + object = mock('hola') + object.should_receive(:to_s).and_return(false) + + @io.puts(object).should == nil + @io.string.should == object.inspect.split(" ")[0] + ">\n" + end end describe "StringIO#puts when passed 1 or more objects" do |