Permalink
Browse files

Specify that StringIO#puts with nil behaves like other IO objects

  • Loading branch information...
1 parent 0c1a67f commit 94f8c3565a6df0d0ff4d78306b0e018f0410e490 @ashmoran committed Jan 20, 2013
Showing with 14 additions and 0 deletions.
  1. +14 −0 spec/ruby/library/stringio/puts_spec.rb
@@ -91,6 +91,20 @@
@io.puts ''
@io.string.should == "\n"
end
+
+ ruby_version_is ""..."1.9" do
+ it "prints a newline when passed nil" do
+ @io.puts nil
+ @io.string.should == "nil\n"
+ end
+ end
+
+ ruby_version_is "1.9" do
+ it "prints a newline when passed nil" do
+ @io.puts nil
+ @io.string.should == "\n"
+ end
+ end
end
describe "StringIO#puts when passed no arguments" do

0 comments on commit 94f8c35

Please sign in to comment.