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

ruby-changes:41669

From: nobu <ko1@a...>
Date: Fri, 5 Feb 2016 13:45:10 +0900 (JST)
Subject: [ruby-changes:41669] nobu:r53743 (trunk): incompatible encoding workaround

nobu	2016-02-05 13:45:10 +0900 (Fri, 05 Feb 2016)

  New Revision: 53743

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

  Log:
    incompatible encoding workaround
    
    * test/lib/minitest/unit.rb (puke): workaround incompatible
      encoding error messages.
    
    * test/lib/test/unit/assertions.rb (AllFailures.message): ditto.

  Modified files:
    trunk/test/lib/minitest/unit.rb
    trunk/test/lib/test/unit/assertions.rb
Index: test/lib/minitest/unit.rb
===================================================================
--- test/lib/minitest/unit.rb	(revision 53742)
+++ test/lib/minitest/unit.rb	(revision 53743)
@@ -998,7 +998,7 @@ module MiniTest https://github.com/ruby/ruby/blob/trunk/test/lib/minitest/unit.rb#L998
           else
             @errors += 1
             bt = MiniTest::filter_backtrace(e.backtrace).join "\n    "
-            "Error:\n#{klass}##{meth}:\n#{e.class}: #{e.message}\n    #{bt}\n"
+            "Error:\n#{klass}##{meth}:\n#{e.class}: #{e.message.b}\n    #{bt}\n"
           end
       @report << e
       e[0, 1]
Index: test/lib/test/unit/assertions.rb
===================================================================
--- test/lib/test/unit/assertions.rb	(revision 53742)
+++ test/lib/test/unit/assertions.rb	(revision 53743)
@@ -801,7 +801,7 @@ eom https://github.com/ruby/ruby/blob/trunk/test/lib/test/unit/assertions.rb#L801
           total = @count.to_s
           fmt = "%#{total.size}d"
           @failures.map {|k, (n, v)|
-            "\n#{i+=1}. [#{fmt%n}/#{total}] Assertion for #{k.inspect}\n#{v.message.gsub(/^/, '   | ')}"
+            "\n#{i+=1}. [#{fmt%n}/#{total}] Assertion for #{k.inspect}\n#{v.message.b.gsub(/^/, '   | ')}"
           }.join("\n")
         end
 

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

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