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

ruby-changes:54734

From: nobu <ko1@a...>
Date: Wed, 30 Jan 2019 20:58:12 +0900 (JST)
Subject: [ruby-changes:54734] nobu:r66951 (trunk): Show the code in syntax assertions

nobu	2019-01-30 20:58:07 +0900 (Wed, 30 Jan 2019)

  New Revision: 66951

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

  Log:
    Show the code in syntax assertions

  Modified files:
    trunk/test/lib/test/unit/assertions.rb
Index: test/lib/test/unit/assertions.rb
===================================================================
--- test/lib/test/unit/assertions.rb	(revision 66950)
+++ test/lib/test/unit/assertions.rb	(revision 66951)
@@ -510,7 +510,13 @@ EOT https://github.com/ruby/ruby/blob/trunk/test/lib/test/unit/assertions.rb#L510
         else
           line = 1
         end
-        yield(code, fname, line, mesg)
+        yield(code, fname, line, message(mesg) {
+                if code.end_with?("\n")
+                  "```\n#{code}```\n"
+                else
+                  "```\n#{code}\n```\n""no-newline"
+                end
+              })
       ensure
         $VERBOSE = verbose
       end

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

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