diff options
author | SHIBATA Hiroshi <shibata.hiroshi@gmail.com> | 2012-12-29 14:07:09 +0900 |
---|---|---|
committer | Prem Sichanugrist <s@sikac.hu> | 2013-02-24 16:32:26 -0500 |
commit | 621b5b7f0e608bc916a66a6e046f11485317949c (patch) | |
tree | afa1a184c13daca882075805a284dabda67631e3 | |
parent | 8598633cc1d5ea402f8b49b1f71cd92180cc1138 (diff) | |
download | rails-621b5b7f0e608bc916a66a6e046f11485317949c.tar.gz rails-621b5b7f0e608bc916a66a6e046f11485317949c.tar.bz2 rails-621b5b7f0e608bc916a66a6e046f11485317949c.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.
-rw-r--r-- | activesupport/lib/active_support/testing/isolation.rb | 12 |
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 6b29ba4c10..77c04758ba 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 |