mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Fixes remote errors in isolation tests
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user