From bf620c09aaba53c9c1c8a5848fd6ca2f9b4ba421 Mon Sep 17 00:00:00 2001
From: SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
Date: Sat, 29 Dec 2012 14:07:09 +0900
Subject: added marshal_load and marshal_dump for ProxyTestResult. Behavior of
 method_missing with Marshal.dump and Marshal.load is changing in ruby 2.0.0
 later.

---
 activesupport/lib/active_support/testing/isolation.rb | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

(limited to 'activesupport')

diff --git a/activesupport/lib/active_support/testing/isolation.rb b/activesupport/lib/active_support/testing/isolation.rb
index 27d444fd91..aa87598926 100644
--- a/activesupport/lib/active_support/testing/isolation.rb
+++ b/activesupport/lib/active_support/testing/isolation.rb
@@ -12,8 +12,8 @@ module ActiveSupport
     end
 
     class ProxyTestResult
-      def initialize
-        @calls = []
+      def initialize(calls = [])
+        @calls = calls
       end
 
       def add_error(e)
@@ -27,6 +27,14 @@ module ActiveSupport
         end
       end
 
+      def marshal_dump
+        @calls
+      end
+
+      def marshal_load(calls)
+        initialize(calls)
+      end
+
       def method_missing(name, *args)
         @calls << [name, args]
       end
-- 
cgit v1.2.3