test/win32ole/test_word.rb: word quit without confirmation dialog to save
files. [Bug #13894] Thanks to h.shirosaki. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
51de1548f4
commit
f10646970b
@ -8,17 +8,22 @@ rescue LoadError
|
|||||||
end
|
end
|
||||||
require "test/unit"
|
require "test/unit"
|
||||||
|
|
||||||
|
if defined?(WIN32OLE)
|
||||||
|
module Word; end
|
||||||
|
end
|
||||||
|
|
||||||
def word_installed?
|
def word_installed?
|
||||||
installed = false
|
installed = false
|
||||||
w = nil
|
w = nil
|
||||||
if defined?(WIN32OLE)
|
if defined?(WIN32OLE)
|
||||||
begin
|
begin
|
||||||
w = WIN32OLE.new('Word.Application')
|
w = WIN32OLE.new('Word.Application')
|
||||||
|
WIN32OLE.const_load(w, Word)
|
||||||
installed = true
|
installed = true
|
||||||
rescue
|
rescue
|
||||||
ensure
|
ensure
|
||||||
if w
|
if w
|
||||||
w.quit
|
w.quit(Word::WdDoNotSaveChanges)
|
||||||
w = nil
|
w = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -59,7 +64,7 @@ if defined?(WIN32OLE)
|
|||||||
|
|
||||||
def teardown
|
def teardown
|
||||||
if @obj
|
if @obj
|
||||||
@obj.quit
|
@obj.quit(Word::WdDoNotSaveChanges)
|
||||||
@obj = nil
|
@obj = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user