Skip to content

Commit edabdd9

Browse files
committed
Run cleanup code in ensure
1 parent 99503ab commit edabdd9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/ruby/test_marshal.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -653,10 +653,10 @@ def test_unloadable_data
653653
Marshal.load(d)
654654
}
655655

656-
# cleanup
656+
ensure
657657
self.class.class_eval do
658658
remove_const name
659-
end
659+
end if c
660660
end
661661

662662
def test_unloadable_userdef
@@ -670,10 +670,10 @@ class << c
670670
Marshal.load(d)
671671
}
672672

673-
# cleanup
673+
ensure
674674
self.class.class_eval do
675675
remove_const name
676-
end
676+
end if c
677677
end
678678

679679
def test_recursive_userdef

0 commit comments

Comments
 (0)