mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fixes remote errors in isolation tests
This commit is contained in:
parent
f8d06e62a9
commit
934bb012ba
1 changed files with 15 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue