From 0ecb32c838b853c35d7939cacde9e5fe715419f9 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 30 Sep 2015 18:25:22 -0700 Subject: 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 --- activesupport/lib/active_support/testing/isolation.rb | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'activesupport/lib/active_support/testing/isolation.rb') 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 -- cgit v1.2.3