aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorSHIBATA Hiroshi <shibata.hiroshi@gmail.com>2012-12-29 14:07:09 +0900
committerSHIBATA Hiroshi <shibata.hiroshi@gmail.com>2013-01-05 09:22:03 +0900
commitbf620c09aaba53c9c1c8a5848fd6ca2f9b4ba421 (patch)
tree5a260b728968c4d3c3ef43c923d4029a192f9296 /activesupport
parent5458f509d9a3ee4f8b9fb4d1f305ecb86417fc33 (diff)
downloadrails-bf620c09aaba53c9c1c8a5848fd6ca2f9b4ba421.tar.gz
rails-bf620c09aaba53c9c1c8a5848fd6ca2f9b4ba421.tar.bz2
rails-bf620c09aaba53c9c1c8a5848fd6ca2f9b4ba421.zip
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.
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/testing/isolation.rb12
1 files changed, 10 insertions, 2 deletions
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