diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-03-28 03:46:48 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-03-28 03:46:48 +0000 |
commit | b3507bf147ff47e331da36ba7c8e6b700c513633 (patch) | |
tree | 770b00214cf732211f90c050146890e6e99b5a87 /test/erb | |
parent | 978290515ea32204ff4b4173d6283050d628bd37 (diff) |
erb.rb: prohibit marshaling [EXPERIMENTAL]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/erb')
-rw-r--r-- | test/erb/test_erb.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/erb/test_erb.rb b/test/erb/test_erb.rb index 9af7e11ef6..16ecf84105 100644 --- a/test/erb/test_erb.rb +++ b/test/erb/test_erb.rb @@ -687,6 +687,19 @@ EOS end end end + + def test_prohibited_marshal_dump + erb = ERB.new("") + assert_raise(TypeError) {Marshal.dump(erb)} + end + + def test_prohibited_marshal_load + erb = ERB.allocate + erb.instance_variable_set(:@src, "") + erb.instance_variable_set(:@lineno, 1) + erb = Marshal.load(Marshal.dump(erb)) + assert_raise(ArgumentError) {erb.result} + end end class TestERBCoreWOStrScan < TestERBCore |