diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-06-27 15:44:20 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-06-27 15:44:20 +0000 |
commit | 9a4f9f3424d6e0b785b2f4cfbcec3f2c2d0ecdcf (patch) | |
tree | e37df3cf56ac8baff676ebb81613f0efe8ea7ef1 /test | |
parent | b020c00c46c65a686f9605dba137796a693f018e (diff) | |
download | ruby-9a4f9f3424d6e0b785b2f4cfbcec3f2c2d0ecdcf.tar.gz |
reapply r46568 "assertions.rb: refine message"
`exception` is an expected exception class, not the raised instance,
so the result message cannot have any backtraces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/lib/test/unit/assertions.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/lib/test/unit/assertions.rb b/test/lib/test/unit/assertions.rb index 869baf505f..435719a22e 100644 --- a/test/lib/test/unit/assertions.rb +++ b/test/lib/test/unit/assertions.rb @@ -126,7 +126,7 @@ module Test raise TypeError, "Expected #{expected.inspect} to be a kind of String or Regexp, not #{expected.class}" end - ex = assert_raise(exception, *msg) {yield} + ex = assert_raise(exception, msg || proc {"Exception(#{exception}) with message matches to #{expected.inspect}"}) {yield} msg = message(msg, "") {"Expected Exception(#{exception}) was raised, but the message doesn't match"} if assert == :assert_equal |