summaryrefslogtreecommitdiff
path: root/ext/-test-/array
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-01-08 19:07:16 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-01-09 22:38:06 +0900
commit590dc06e3840cc7b00d80ccaac9fbf42573428f8 (patch)
treee5f6aa316246401b8d89e7419ddf0976238c04b5 /ext/-test-/array
parent161a20df28dd09ff35a32a7e2b7ce6cab7079707 (diff)
Get rid of defining methods for tests in core classes
Not to interfere in other tests.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4043
Diffstat (limited to 'ext/-test-/array')
-rw-r--r--ext/-test-/array/resize/resize.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/-test-/array/resize/resize.c b/ext/-test-/array/resize/resize.c
index 08bcee3..cfe910e 100644
--- a/ext/-test-/array/resize/resize.c
+++ b/ext/-test-/array/resize/resize.c
@@ -1,7 +1,7 @@
#include "ruby/ruby.h"
static VALUE
-ary_resize(VALUE ary, VALUE len)
+ary_resize(VALUE klass, VALUE ary, VALUE len)
{
rb_ary_resize(ary, NUM2LONG(len));
return ary;
@@ -10,5 +10,7 @@ ary_resize(VALUE ary, VALUE len)
void
Init_resize(void)
{
- rb_define_method(rb_cArray, "__resize__", ary_resize, 1);
+ VALUE mBug = rb_define_module("Bug");
+ VALUE klass = rb_define_class_under(mBug, "Array", rb_cObject);
+ rb_define_singleton_method(klass, "__resize__", ary_resize, 2);
}