mirror of
https://github.com/ruby/ruby.git
synced 2025-08-24 13:34:17 +02:00
Run cleanup code in ensure
This commit is contained in:
parent
99503ab975
commit
edabdd95a8
1 changed files with 4 additions and 4 deletions
|
@ -653,10 +653,10 @@ class TestMarshal < Test::Unit::TestCase
|
||||||
Marshal.load(d)
|
Marshal.load(d)
|
||||||
}
|
}
|
||||||
|
|
||||||
# cleanup
|
ensure
|
||||||
self.class.class_eval do
|
self.class.class_eval do
|
||||||
remove_const name
|
remove_const name
|
||||||
end
|
end if c
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_unloadable_userdef
|
def test_unloadable_userdef
|
||||||
|
@ -670,10 +670,10 @@ class TestMarshal < Test::Unit::TestCase
|
||||||
Marshal.load(d)
|
Marshal.load(d)
|
||||||
}
|
}
|
||||||
|
|
||||||
# cleanup
|
ensure
|
||||||
self.class.class_eval do
|
self.class.class_eval do
|
||||||
remove_const name
|
remove_const name
|
||||||
end
|
end if c
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_recursive_userdef
|
def test_recursive_userdef
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue