summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2025-03-21 11:05:57 +0900
committerNobuyoshi Nakada <[email protected]>2025-03-21 11:05:57 +0900
commitedabdd95a84a31c61bab651584d58fe7f695552a (patch)
tree9b51a4a51a1374ab747ea4ba7fae0f90e1822c78 /test/ruby
parent99503ab9751c09a2f5467dee4ceb0e30af4e95bd (diff)
Run cleanup code in `ensure`
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_marshal.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb
index 404a954c4b..e4f6e5e91a 100644
--- a/test/ruby/test_marshal.rb
+++ b/test/ruby/test_marshal.rb
@@ -653,10 +653,10 @@ class TestMarshal < Test::Unit::TestCase
Marshal.load(d)
}
- # cleanup
+ ensure
self.class.class_eval do
remove_const name
- end
+ end if c
end
def test_unloadable_userdef
@@ -670,10 +670,10 @@ class TestMarshal < Test::Unit::TestCase
Marshal.load(d)
}
- # cleanup
+ ensure
self.class.class_eval do
remove_const name
- end
+ end if c
end
def test_recursive_userdef