jruby-win32ole
jruby-win32ole copied to clipboard
WIN32OLE.const_load should accept a string as its first argument for compatibility
require 'win32ole'
module Constants
end
WIN32OLE.const_load("Microsoft Excel 12.0 Object Library", Constants)
Expected behavior: Some constants should be loaded into the Constants module, according to MRI's win32ole behavior.
Actual behavior: NoMethodError: undefined method
type_info' for "Microsoft Excel 12.0 Object Library"`
According to http://ruby-doc.org/stdlib-1.9.3/libdoc/win32ole/rdoc/WIN32OLE.html#method-c-const_load,
The first argument is WIN32OLE object or type library name.
MRI checks the class of the first argument here https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole.c#L2817