Wrap undef_method :a with ensure

This commit is contained in:
Gary Tou 2023-04-26 09:08:16 -04:00 committed by Aaron Patterson
parent 96a2e27185
commit 78be6696d8

View File

@ -311,9 +311,9 @@ class TestDefined < Test::Unit::TestCase
end
assert_nil(a)
ensure
BasicObject.class_eval do
undef_method :a
undef_method :a if defined?(a)
end
end