diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2015-09-30 18:25:22 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2015-09-30 18:25:22 -0700 |
commit | 0ecb32c838b853c35d7939cacde9e5fe715419f9 (patch) | |
tree | e755140e62c56b92b4d185d9b5bc8b2e4db44108 /activesupport/lib/active_support/testing | |
parent | 023aca27842b26fb8061bd1298e48395f71c0049 (diff) | |
download | rails-0ecb32c838b853c35d7939cacde9e5fe715419f9.tar.gz rails-0ecb32c838b853c35d7939cacde9e5fe715419f9.tar.bz2 rails-0ecb32c838b853c35d7939cacde9e5fe715419f9.zip |
make sure exceptions are marshalable when returning test results
this should fix the error where isolation tests raise an exception and
we just get a marshal error
Diffstat (limited to 'activesupport/lib/active_support/testing')
-rw-r--r-- | activesupport/lib/active_support/testing/isolation.rb | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/testing/isolation.rb b/activesupport/lib/active_support/testing/isolation.rb index 1de0a19998..edf8b30a0a 100644 --- a/activesupport/lib/active_support/testing/isolation.rb +++ b/activesupport/lib/active_support/testing/isolation.rb @@ -41,7 +41,23 @@ module ActiveSupport pid = fork do read.close yield - write.puts [Marshal.dump(self.dup)].pack("m") + begin + if error? + failures.map! { |e| + begin + Marshal.dump e + e + rescue TypeError + ex = Exception.new e.message + ex.set_backtrace e.backtrace + Minitest::UnexpectedError.new ex + end + } + end + result = Marshal.dump(self.dup) + end + + write.puts [result].pack("m") exit! end |