summaryrefslogtreecommitdiff
path: root/test/win32ole/test_folderitem2_invokeverb.rb
diff options
context:
space:
mode:
authorsuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-12-26 12:09:57 +0000
committersuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-12-26 12:09:57 +0000
commit0aa4340d81c673bdf093c3a3691dea28bda82bd5 (patch)
tree7afa7a83470d7eb4f7d0d9efa7dcb0a0509d26ae /test/win32ole/test_folderitem2_invokeverb.rb
parenta17e7d92a2d7791094d76d57dd43f1305f321eca (diff)
The argument of Shell.NameSpace should not be file path.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/win32ole/test_folderitem2_invokeverb.rb')
-rw-r--r--test/win32ole/test_folderitem2_invokeverb.rb15
1 files changed, 9 insertions, 6 deletions
diff --git a/test/win32ole/test_folderitem2_invokeverb.rb b/test/win32ole/test_folderitem2_invokeverb.rb
index 974c5007765..a4e90fb66b5 100644
--- a/test/win32ole/test_folderitem2_invokeverb.rb
+++ b/test/win32ole/test_folderitem2_invokeverb.rb
@@ -16,14 +16,16 @@ if defined?(WIN32OLE)
#
@fso = WIN32OLE.new('Scripting.FileSystemObject')
- @dummy_path = @fso.GetTempName
+ @dummy_file = @fso.GetTempName
@cfolder = @fso.getFolder(".")
- f = @cfolder.CreateTextFile(@dummy_path)
+ f = @cfolder.CreateTextFile(@dummy_file)
f.close
- @dummy_path = @cfolder.path + "\\" + @dummy_path
+ @dummy_path = @cfolder.path + "\\" + @dummy_file
@shell=WIN32OLE.new('Shell.Application')
- @fi2 = @shell.NameSpace(@dummy_path).ParentFolder.ParseName(@shell.NameSpace(@dummy_path).Title)
+ @nsp = @shell.NameSpace(@cfolder.path)
+ @fi2 = @nsp.parseName(@dummy_file)
+
@shortcut = nil
#
@@ -44,7 +46,7 @@ if defined?(WIN32OLE)
arlink = []
@cfolder.files.each do |f|
if /\.lnk$/ =~ f.path
- linkinfo = @shell.NameSpace(f.path).self.getlink
+ linkinfo = @nsp.parseName(f.name).getLink
arlink.push f if linkinfo.path == path
end
end
@@ -55,8 +57,9 @@ if defined?(WIN32OLE)
links = find_link(@dummy_path)
assert(0, links.size)
- # Now create shortcut to @dummy_path
assert(@shortcut)
+
+ # Now create shortcut to @dummy_path
arg = WIN32OLE_VARIANT.new(@shortcut)
@fi2.InvokeVerb(arg)