[前][次][番号順一覧][スレッド一覧]

ruby-changes:40818

From: nobu <ko1@a...>
Date: Sat, 5 Dec 2015 17:33:45 +0900 (JST)
Subject: [ruby-changes:40818] nobu:r52897 (trunk): assertions.rb: fallback encoding error

nobu	2015-12-05 17:33:38 +0900 (Sat, 05 Dec 2015)

  New Revision: 52897

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=52897

  Log:
    assertions.rb: fallback encoding error
    
    * test/lib/test/unit/assertions.rb (message): fallback when
      outputs from different encoding commands mixed.

  Modified files:
    trunk/test/lib/test/unit/assertions.rb
Index: test/lib/test/unit/assertions.rb
===================================================================
--- test/lib/test/unit/assertions.rb	(revision 52896)
+++ test/lib/test/unit/assertions.rb	(revision 52897)
@@ -490,7 +490,11 @@ EOT https://github.com/ruby/ruby/blob/trunk/test/lib/test/unit/assertions.rb#L490
             if 1 < ary.length
               ary[0...-1] = ary[0...-1].map {|str| str.sub(/(?<!\.)\z/, '.') }
             end
-            ary.join("\n")
+            begin
+              ary.join("\n")
+            rescue Encoding::CompatibilityError
+              ary.map(&:b).join("\n")
+            end
           end
         else
           super

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]