diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-01-30 11:58:07 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-01-30 11:58:07 +0000 |
commit | 15f8fb34fa82ecb4c20c7dde3d10ca4a3206c408 (patch) | |
tree | d4975c59ffab8cd1414e34231b0366f9ebad0552 /test/lib/test/unit | |
parent | ea88f7ddf914a85b82f4c228a2e1278c55dff962 (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.rb | 8 |
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 |