summaryrefslogtreecommitdiff
path: root/test/lib/test/unit
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-01-30 11:58:07 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-01-30 11:58:07 +0000
commit15f8fb34fa82ecb4c20c7dde3d10ca4a3206c408 (patch)
treed4975c59ffab8cd1414e34231b0366f9ebad0552 /test/lib/test/unit
parentea88f7ddf914a85b82f4c228a2e1278c55dff962 (diff)
Show the code in syntax assertions
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/lib/test/unit')
-rw-r--r--test/lib/test/unit/assertions.rb8
1 files changed, 7 insertions, 1 deletions
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