Permalink
Browse files

Fixes remote errors in isolation tests

  • Loading branch information...
1 parent f8d06e6 commit 934bb012ba3f1da5cd181ae5c2d84f697a3c58a1 Yehuda Katz committed Nov 23, 2009
Showing with 15 additions and 0 deletions.
  1. +15 −0 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)

0 comments on commit 934bb01

Please sign in to comment.