From 9bb6a05283ce7f3deb57c707b16c60b43abd3e97 Mon Sep 17 00:00:00 2001 From: usa Date: Tue, 21 Aug 2012 01:57:19 +0000 Subject: * test/unit/test.rb (Test::Unit::ProxyError): new exception class to wrap exceptions raised in workers in parallel test mode. * test/unit/parallel.rb (Test::Unit::Worker#puke): use above warpper exception. [Bug #6882] [ruby-dev:46054] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/test/unit.rb | 9 +++++++++ lib/test/unit/parallel.rb | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'lib/test') diff --git a/lib/test/unit.rb b/lib/test/unit.rb index a0902acb8b..c29facca71 100644 --- a/lib/test/unit.rb +++ b/lib/test/unit.rb @@ -824,6 +824,15 @@ module Test new(*args).run end end + + class ProxyError < StandardError + def initialize(ex) + @message = ex.message + @backtrace = ex.backtrace + end + + attr_accessor :message, :backtrace + end end end diff --git a/lib/test/unit/parallel.rb b/lib/test/unit/parallel.rb index 32f15382ec..921c6b0b02 100644 --- a/lib/test/unit/parallel.rb +++ b/lib/test/unit/parallel.rb @@ -155,7 +155,7 @@ module Test end def puke(klass, meth, e) - @partial_report << [klass.name, meth, e] + @partial_report << [klass.name, meth, e.is_a?(MiniTest::Assertion) ? e : ProxyError.new(e)] super end end -- cgit v1.2.3