From 15f8fb34fa82ecb4c20c7dde3d10ca4a3206c408 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 30 Jan 2019 11:58:07 +0000 Subject: [PATCH] Show the code in syntax assertions git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/lib/test/unit/assertions.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/lib/test/unit/assertions.rb b/test/lib/test/unit/assertions.rb index 32f6fc6d0c..caee3b18f7 100644 --- a/test/lib/test/unit/assertions.rb +++ b/test/lib/test/unit/assertions.rb @@ -510,7 +510,13 @@ EOT 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