diff options
author | Yehuda Katz <wycats@Yehuda-Katz.local> | 2009-11-23 15:42:25 -0800 |
---|---|---|
committer | Yehuda Katz <wycats@Yehuda-Katz.local> | 2009-11-23 15:42:25 -0800 |
commit | 934bb012ba3f1da5cd181ae5c2d84f697a3c58a1 (patch) | |
tree | a46d6c65c5c67964bc8658bf991157f0f8056f55 /activesupport/lib | |
parent | f8d06e62a9084e0c862128bd9fcbb053676a007e (diff) | |
download | rails-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.rb | 15 |
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) |