Fixes remote errors in isolation tests

This commit is contained in:
Yehuda Katz
2009-11-23 15:42:25 -08:00
parent f8d06e62a9
commit 934bb012ba

View File

@@ -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)