diff options
Diffstat (limited to 'spec/ruby/library/win32ole/win32ole_method/helpcontext_spec.rb')
| -rw-r--r-- | spec/ruby/library/win32ole/win32ole_method/helpcontext_spec.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/ruby/library/win32ole/win32ole_method/helpcontext_spec.rb b/spec/ruby/library/win32ole/win32ole_method/helpcontext_spec.rb new file mode 100644 index 0000000000..88164bcd1f --- /dev/null +++ b/spec/ruby/library/win32ole/win32ole_method/helpcontext_spec.rb @@ -0,0 +1,27 @@ +require_relative "../../../spec_helper" +platform_is :windows do + require 'win32ole' + + describe "WIN32OLE::Method#helpcontext" do + before :each do + ole_type = WIN32OLE::Type.new("Microsoft Scripting Runtime", "FileSystemObject") + @get_file_version = WIN32OLE::Method.new(ole_type, "GetFileVersion") + 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 + -> { @get_file_version.helpcontext(1) }.should.raise ArgumentError + end + + it "returns expected value for FileSystemObject's 'GetFileVersion' method" do + @get_file_version.helpcontext.should == 0 + 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 |
