diff options
author | KJ Tsanaktsidis <[email protected]> | 2024-08-09 10:35:54 +1000 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2024-08-20 18:36:16 +0900 |
commit | 927a44b43f1db2527a4fe6709ec0867dea3ca58f (patch) | |
tree | a7e43bd87c72ba91ec72f67c1e5a0ba7fc39221c /ext | |
parent | 5e3dd6d395ca551152c8920f69f39823efeab748 (diff) |
Rewrite #test_redefinition_mismatch to use a dedicated test class
This test is checking what happens if you try and define a class in a C
extension where that constant is already not a class. It was doing this
by overriding ::Date and then trying to require 'date. The issue with
this is that if we ever add 'date' as a dependency for the test runner,
this test will break because the test runner files get implicitly
required in an `assert_separately` block.
Better use an explicit class for this purpose which can't be accidentally
required elsewhere.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/11400
Diffstat (limited to 'ext')
-rw-r--r-- | ext/-test-/class/init.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/ext/-test-/class/init.c b/ext/-test-/class/init.c index ed715c1942..108ff7525c 100644 --- a/ext/-test-/class/init.c +++ b/ext/-test-/class/init.c @@ -7,5 +7,6 @@ Init_class(void) { VALUE mBug = rb_define_module("Bug"); VALUE mod = rb_define_module_under(mBug, "Class"); + rb_define_class_under(mod, "TestClassDefinedInC", rb_cObject); TEST_INIT_FUNCS(init); } |