summaryrefslogtreecommitdiff
path: root/ext/-test-/win32/console/attribute.c
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-/win32/console/attribute.c
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-/win32/console/attribute.c')
-rw-r--r--ext/-test-/win32/console/attribute.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/-test-/win32/console/attribute.c b/ext/-test-/win32/console/attribute.c
index a5f80fc..e3e80a1 100644
--- a/ext/-test-/win32/console/attribute.c
+++ b/ext/-test-/win32/console/attribute.c
@@ -13,7 +13,7 @@ io_handle(VALUE io)
}
static VALUE
-console_info(VALUE io)
+console_info(VALUE klass, VALUE io)
{
HANDLE h = io_handle(io);
CONSOLE_SCREEN_BUFFER_INFO csbi;
@@ -29,7 +29,7 @@ console_info(VALUE io)
}
static VALUE
-console_set_attribute(VALUE io, VALUE attr)
+console_set_attribute(VALUE klass, VALUE io, VALUE attr)
{
HANDLE h = io_handle(io);
@@ -47,8 +47,8 @@ Init_attribute(VALUE m)
"size_x", "size_y",
"cur_x", "cur_y",
"attr", NULL);
- rb_define_method(rb_cIO, "console_info", console_info, 0);
- rb_define_method(rb_cIO, "console_attribute", console_set_attribute, 1);
+ rb_define_singleton_method(m, "console_info", console_info, 1);
+ rb_define_singleton_method(m, "console_attribute", console_set_attribute, 2);
rb_define_const(m, "FOREGROUND_MASK", INT2FIX(FOREGROUND_MASK));
rb_define_const(m, "FOREGROUND_BLUE", INT2FIX(FOREGROUND_BLUE));