mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Remove cvar overtaken classes at end of test methods
Fixes issues when the same tests are executed more than once, which some CI machines do.
This commit is contained in:
parent
cbc7c1c061
commit
d9fea496af
1 changed files with 6 additions and 0 deletions
|
@ -96,6 +96,9 @@ class TestVariable < Test::Unit::TestCase
|
|||
EORB
|
||||
|
||||
assert_equal "class variable @@cvar of TestVariable::Child is overtaken by TestVariable::Parent", error.message
|
||||
ensure
|
||||
TestVariable.send(:remove_const, :Child) rescue nil
|
||||
TestVariable.send(:remove_const, :Parent) rescue nil
|
||||
end
|
||||
|
||||
def test_cvar_overtaken_by_module
|
||||
|
@ -124,6 +127,9 @@ class TestVariable < Test::Unit::TestCase
|
|||
EORB
|
||||
|
||||
assert_equal "class variable @@cvar of TestVariable::ParentForModule is overtaken by TestVariable::Mixin", error.message
|
||||
ensure
|
||||
TestVariable.send(:remove_const, :Mixin) rescue nil
|
||||
TestVariable.send(:remove_const, :ParentForModule) rescue nil
|
||||
end
|
||||
|
||||
class IncludeRefinedModuleClassVariableNoWarning
|
||||
|
|
Loading…
Reference in a new issue