From 934bb012ba3f1da5cd181ae5c2d84f697a3c58a1 Mon Sep 17 00:00:00 2001 From: Yehuda Katz Date: Mon, 23 Nov 2009 15:42:25 -0800 Subject: [PATCH] Fixes remote errors in isolation tests --- .../lib/active_support/testing/isolation.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/activesupport/lib/active_support/testing/isolation.rb b/activesupport/lib/active_support/testing/isolation.rb index c75b59c284..81f7e3c9df 100644 --- a/activesupport/lib/active_support/testing/isolation.rb +++ b/activesupport/lib/active_support/testing/isolation.rb @@ -1,10 +1,25 @@ module ActiveSupport module Testing + class RemoteError < StandardError + + attr_reader :message, :backtrace + + def initialize(exception) + @message = "caught #{exception.class.name}: #{exception.message}" + @backtrace = exception.backtrace + end + end + class ProxyTestResult def initialize @calls = [] end + def add_error(e) + e = Test::Unit::Error.new(e.test_name, RemoteError.new(e.exception)) + @calls << [:add_error, e] + end + def __replay__(result) @calls.each do |name, args| result.send(name, *args)