1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/win32ole] Undefine allocator of WIN32OLE_VARIABLE to get rid of warning

https://github.com/ruby/win32ole/commit/27d0fdc622
This commit is contained in:
Nobuyoshi Nakada 2021-12-28 13:54:16 +09:00
parent 31c69d66d2
commit db547a3bc4
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6
2 changed files with 5 additions and 0 deletions

View file

@ -370,6 +370,7 @@ VALUE cWIN32OLE_VARIABLE;
void Init_win32ole_variable(void)
{
cWIN32OLE_VARIABLE = rb_define_class("WIN32OLE_VARIABLE", rb_cObject);
rb_undef_alloc_func(cWIN32OLE_VARIABLE);
rb_define_method(cWIN32OLE_VARIABLE, "name", folevariable_name, 0);
rb_define_method(cWIN32OLE_VARIABLE, "ole_type", folevariable_ole_type, 0);
rb_define_method(cWIN32OLE_VARIABLE, "ole_type_detail", folevariable_ole_type_detail, 0);

View file

@ -16,6 +16,10 @@ if defined?(WIN32OLE_VARIABLE)
@var2 = variables.find {|v| v.name == 'UILevel'}
end
def test_initialize
assert_raise(TypeError) {WIN32OLE_VARIABLE.new}
end
def test_name
assert_equal('ssfDESKTOP', @var1.name)
end