ruby-changes:29812
From: kou <ko1@a...>
Date: Tue, 9 Jul 2013 21:43:04 +0900 (JST)
Subject: [ruby-changes:29812] kou:r41864 (trunk): * test/rexml/test_text.rb: Add missing tests for Text#<<.
kou 2013-07-09 21:41:26 +0900 (Tue, 09 Jul 2013) New Revision: 41864 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=41864 Log: * test/rexml/test_text.rb: Add missing tests for Text#<<. Reported by nagachika. Thanks!!! Added files: trunk/test/rexml/test_text.rb Modified files: trunk/ChangeLog Index: ChangeLog =================================================================== --- ChangeLog (revision 41863) +++ ChangeLog (revision 41864) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Tue Jul 9 21:40:01 2013 Kouhei Sutou <kou@c...> + + * test/rexml/test_text.rb: Add missing tests for Text#<<. + Reported by nagachika. Thanks!!! + Tue Jul 9 18:02:38 2013 Akinori MUSHA <knu@i...> * lib/fileutils.rb (FileUtils#chown_R): Do not skip traversal even @@ -206,15 +211,11 @@ Sun Jul 7 11:49:19 2013 Kouhei Sutou https://github.com/ruby/ruby/blob/trunk/ChangeLog#L211 * lib/rexml/text.rb (REXML::Text#<<): Support appending in not "raw" mode. [Bug #8602] [ruby-dev:47482] Reported by Ippei Obayashi. Thanks!!! - * test/rexml/test_text.rb (TextTester#test_shift_operator_cache): - Add a test for the above case. Sun Jul 7 11:43:13 2013 Kouhei Sutou <kou@c...> * lib/rexml/text.rb (REXML::Text#<<): Support method chain use by "<<" like other objects. - * test/rexml/test_text.rb (TextTester#test_shift_operator_chain): - Add a test for the above case. Sun Jul 7 11:34:18 2013 Kouhei Sutou <kou@c...> Index: test/rexml/test_text.rb =================================================================== --- test/rexml/test_text.rb (revision 0) +++ test/rexml/test_text.rb (revision 41864) @@ -0,0 +1,19 @@ https://github.com/ruby/ruby/blob/trunk/test/rexml/test_text.rb#L1 +require "rexml/text" + +class TextTester < Test::Unit::TestCase + include REXML + + def test_shift_operator_chain + text = Text.new("original\r\n") + text << "append1\r\n" << "append2\r\n" + assert_equal("original\nappend1\nappend2\n", text.to_s) + end + + def test_shift_operator_cache + text = Text.new("original\r\n") + text << "append1\r\n" << "append2\r\n" + assert_equal("original\nappend1\nappend2\n", text.to_s) + text << "append3\r\n" << "append4\r\n" + assert_equal("original\nappend1\nappend2\nappend3\nappend4\n", text.to_s) + end +end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/