aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorYehuda Katz <wycats@Yehuda-Katz.local>2009-11-23 15:42:25 -0800
committerYehuda Katz <wycats@Yehuda-Katz.local>2009-11-23 15:42:25 -0800
commit934bb012ba3f1da5cd181ae5c2d84f697a3c58a1 (patch)
treea46d6c65c5c67964bc8658bf991157f0f8056f55 /activesupport/lib
parentf8d06e62a9084e0c862128bd9fcbb053676a007e (diff)
downloadrails-934bb012ba3f1da5cd181ae5c2d84f697a3c58a1.tar.gz
rails-934bb012ba3f1da5cd181ae5c2d84f697a3c58a1.tar.bz2
rails-934bb012ba3f1da5cd181ae5c2d84f697a3c58a1.zip
Fixes remote errors in isolation tests
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/testing/isolation.rb15
1 files changed, 15 insertions, 0 deletions
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)