aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2017-02-24 19:17:01 -0500
committerRafael Mendonça França <rafaelmfranca@gmail.com>2017-02-24 19:17:01 -0500
commitfeea081199f1398e7fa97bf22eb6081ecd2d6174 (patch)
tree728cc947ca4f84262bb6850d7c082355851e589b /activesupport/test/core_ext
parentccb009511685adac1d14d3c1e07dde640d0d7042 (diff)
parenta72498f776b2e67b7e3a074423181defcd06fc56 (diff)
downloadrails-feea081199f1398e7fa97bf22eb6081ecd2d6174.tar.gz
rails-feea081199f1398e7fa97bf22eb6081ecd2d6174.tar.bz2
rails-feea081199f1398e7fa97bf22eb6081ecd2d6174.zip
Merge pull request #28006 from fareastside/master
Allow ActiveSupport::MarshalWithAutoloading#load to take a Proc
Diffstat (limited to 'activesupport/test/core_ext')
-rw-r--r--activesupport/test/core_ext/marshal_test.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/marshal_test.rb b/activesupport/test/core_ext/marshal_test.rb
index a899f98705..cabeed2fae 100644
--- a/activesupport/test/core_ext/marshal_test.rb
+++ b/activesupport/test/core_ext/marshal_test.rb
@@ -19,6 +19,19 @@ class MarshalTest < ActiveSupport::TestCase
end
end
+ test "that Marshal#load still works when passed a proc" do
+ example_string = "test"
+
+ example_proc = Proc.new do |o|
+ if o.is_a?(String)
+ o.capitalize!
+ end
+ end
+
+ dumped = Marshal.dump(example_string)
+ assert_equal Marshal.load(dumped, example_proc), "Test"
+ end
+
test "that a missing class is autoloaded from string" do
dumped = nil
with_autoloading_fixtures do