Fix small issues concerning namespacing in test-all suite
* Fix temporary methods on Object leaking across test cases. * Remove temporary classes/modules leaking across test cases.
This commit is contained in:
parent
5825d7d4a1
commit
d2c6dca8f4
Notes:
git
2023-03-16 23:46:58 +00:00
@ -123,6 +123,8 @@ class TestIseqLoad < Test::Unit::TestCase
|
|||||||
assert_equal false, test_break_ensure_def_method
|
assert_equal false, test_break_ensure_def_method
|
||||||
omit "failing due to exception entry sp mismatch"
|
omit "failing due to exception entry sp mismatch"
|
||||||
assert_iseq_roundtrip(src)
|
assert_iseq_roundtrip(src)
|
||||||
|
ensure
|
||||||
|
Object.undef_method(:test_break_ensure_def_method) rescue nil
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_kwarg
|
def test_kwarg
|
||||||
|
@ -488,6 +488,9 @@ class TestEval < Test::Unit::TestCase
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
assert_equal(feature6609, feature6609_method)
|
assert_equal(feature6609, feature6609_method)
|
||||||
|
ensure
|
||||||
|
Object.undef_method(:feature6609_block) rescue nil
|
||||||
|
Object.undef_method(:feature6609_method) rescue nil
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_eval_using_integer_as_binding
|
def test_eval_using_integer_as_binding
|
||||||
|
@ -637,6 +637,8 @@ class TestISeq < Test::Unit::TestCase
|
|||||||
}
|
}
|
||||||
|
|
||||||
lines
|
lines
|
||||||
|
ensure
|
||||||
|
Object.send(:remove_const, :A) rescue nil
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_to_binary_line_tracepoint
|
def test_to_binary_line_tracepoint
|
||||||
|
@ -1728,6 +1728,8 @@ class TestModule < Test::Unit::TestCase
|
|||||||
assert_equal("TestModule::C\u{df}", c.name, '[ruby-core:24600]')
|
assert_equal("TestModule::C\u{df}", c.name, '[ruby-core:24600]')
|
||||||
c = Module.new.module_eval("class X\u{df} < Module; self; end")
|
c = Module.new.module_eval("class X\u{df} < Module; self; end")
|
||||||
assert_match(/::X\u{df}:/, c.new.to_s)
|
assert_match(/::X\u{df}:/, c.new.to_s)
|
||||||
|
ensure
|
||||||
|
Object.send(:remove_const, "C\u{df}")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -210,6 +210,7 @@ class TestRequire < Test::Unit::TestCase
|
|||||||
assert_not_nil(bt = e.backtrace, "no backtrace")
|
assert_not_nil(bt = e.backtrace, "no backtrace")
|
||||||
assert_not_empty(bt.find_all {|b| b.start_with? __FILE__}, proc {bt.inspect})
|
assert_not_empty(bt.find_all {|b| b.start_with? __FILE__}, proc {bt.inspect})
|
||||||
end
|
end
|
||||||
|
ensure
|
||||||
$LOADED_FEATURES.replace loaded_features
|
$LOADED_FEATURES.replace loaded_features
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user