2017-05-07 08:04:49 -04:00
|
|
|
platform_is :windows do
|
|
|
|
require 'win32ole'
|
|
|
|
|
|
|
|
describe "WIN32OLE_METHOD#helpcontext" do
|
|
|
|
before :each do
|
2018-12-06 16:56:55 -05:00
|
|
|
ole_type = WIN32OLE_TYPE.new("Microsoft Scripting Runtime", "FileSystemObject")
|
|
|
|
@get_file_version = WIN32OLE_METHOD.new(ole_type, "GetFileVersion")
|
2017-05-07 08:04:49 -04:00
|
|
|
ole_type = WIN32OLE_TYPE.new("Microsoft Scripting Runtime", "File")
|
|
|
|
@m_file_name = WIN32OLE_METHOD.new(ole_type, "name")
|
|
|
|
end
|
|
|
|
|
|
|
|
it "raises ArgumentError if argument is given" do
|
2019-07-27 06:40:09 -04:00
|
|
|
-> { @get_file_version.helpcontext(1) }.should raise_error ArgumentError
|
2017-05-07 08:04:49 -04:00
|
|
|
end
|
|
|
|
|
2018-12-06 16:56:55 -05:00
|
|
|
it "returns expected value for FileSystemObject's 'GetFileVersion' method" do
|
|
|
|
@get_file_version.helpcontext.should == 0
|
2017-05-07 08:04:49 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
it "returns expected value for Scripting Runtime's 'name' method" do
|
|
|
|
@m_file_name.helpcontext.should == 2181996 # value indicated in MRI's test
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|