summaryrefslogtreecommitdiff
path: root/test/ruby/test_marshal.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-01-11 00:33:26 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-01-11 00:33:26 +0900
commit480f436dacc28def6c23d6b914f03ac6a0753d5d (patch)
treea64fe0c1bdc609623cd20df200bb1eca67b43f62 /test/ruby/test_marshal.rb
parentc63552eab1a13c6c05e18d763c7acf3c4c5383ed (diff)
downloadruby-480f436dacc28def6c23d6b914f03ac6a0753d5d.tar.gz
Suppress constant redefinition warnings
Diffstat (limited to 'test/ruby/test_marshal.rb')
-rw-r--r--test/ruby/test_marshal.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb
index ef8b261321..d2b4ec169f 100644
--- a/test/ruby/test_marshal.rb
+++ b/test/ruby/test_marshal.rb
@@ -58,6 +58,8 @@ class TestMarshal < Test::Unit::TestCase
TestMarshal.instance_eval { remove_const :StructOrNot }
TestMarshal.const_set :StructOrNot, Class.new
assert_raise(TypeError, "[ruby-dev:31709]") { Marshal.load(s) }
+ ensure
+ TestMarshal.instance_eval { remove_const :StructOrNot }
end
def test_struct_invalid_members
@@ -66,6 +68,8 @@ class TestMarshal < Test::Unit::TestCase
Marshal.load("\004\bIc&TestMarshal::StructInvalidMembers\006:\020__members__\"\bfoo")
TestMarshal::StructInvalidMembers.members
}
+ ensure
+ TestMarshal.instance_eval { remove_const :StructInvalidMembers }
end
class C