From 12bde2dfabc3492d490e6c53628cf8cdf04495ff Mon Sep 17 00:00:00 2001 From: naruse Date: Wed, 16 Nov 2011 00:59:56 +0000 Subject: [PATCH] * lib/minitest/unit.rb (assert_raises): experimental fix to run correctly on chkbuild over 64bit linux. call exception_details only when the detail is really needed to avoid create needless inspect under ulimit-ed environment. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 7 +++++++ lib/minitest/unit.rb | 7 ++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 39f066f188..c137bc431d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Wed Nov 16 09:39:27 2011 NARUSE, Yui + + * lib/minitest/unit.rb (assert_raises): experimental fix to run + correctly on chkbuild over 64bit linux. call exception_details only + when the detail is really needed to avoid create needless inspect + under ulimit-ed environment. + Wed Nov 16 06:34:30 2011 Tanaka Akira * test/ruby/test_thread.rb (test_condvar_timed_wait): use diff --git a/lib/minitest/unit.rb b/lib/minitest/unit.rb index 38e3f3a83e..677aae767f 100644 --- a/lib/minitest/unit.rb +++ b/lib/minitest/unit.rb @@ -357,9 +357,10 @@ module MiniTest end rescue Exception => e details = "#{msg}#{mu_pp(exp)} exception expected, not" - assert(exp.any? { |ex| - ex.instance_of?(Module) ? e.kind_of?(ex) : ex == e.class - }, exception_details(e, details)) + bool = exp.any? { |ex| + ex.instance_of?(Module) ? e.kind_of?(ex) : ex == e.class + } + assert(bool, exception_details(e, details)) unless bool return e end