[macruby-changes] [1455] MacRuby/branches/experimental/spec/frozen/library/stringio/puts_spec .rb

source_changes at macosforge.org source_changes at macosforge.org
Wed Apr 22 15:10:05 PDT 2009


Revision: 1455
          http://trac.macosforge.org/projects/ruby/changeset/1455
Author:   eloy.de.enige at gmail.com
Date:     2009-04-22 15:10:05 -0700 (Wed, 22 Apr 2009)
Log Message:
-----------
Add a round-tripping spec for StringIO#puts with encoded text.

Modified Paths:
--------------
    MacRuby/branches/experimental/spec/frozen/library/stringio/puts_spec.rb

Modified: MacRuby/branches/experimental/spec/frozen/library/stringio/puts_spec.rb
===================================================================
--- MacRuby/branches/experimental/spec/frozen/library/stringio/puts_spec.rb	2009-04-22 22:09:54 UTC (rev 1454)
+++ MacRuby/branches/experimental/spec/frozen/library/stringio/puts_spec.rb	2009-04-22 22:10:05 UTC (rev 1455)
@@ -140,3 +140,13 @@
     lambda { io.puts }.should raise_error(IOError)
   end
 end
+
+describe "StringIO#puts when passed an encoded string" do
+  it "stores the bytes unmodified" do
+    io = StringIO.new
+    io.puts "\x00\x01\x02"
+    io.puts "æåø"
+
+    io.string.should == "\x00\x01\x02\næåø\n"
+  end
+end
\ No newline at end of file
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090422/5c7f618b/attachment-0001.html>


More information about the macruby-changes mailing list