mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
1 changed files with 7 additions and 2 deletions
|
@ -8,17 +8,22 @@ rescue LoadError
|
|||
end
|
||||
require "test/unit"
|
||||
|
||||
if defined?(WIN32OLE)
|
||||
module Word; end
|
||||
end
|
||||
|
||||
def word_installed?
|
||||
installed = false
|
||||
w = nil
|
||||
if defined?(WIN32OLE)
|
||||
begin
|
||||
w = WIN32OLE.new('Word.Application')
|
||||
WIN32OLE.const_load(w, Word)
|
||||
installed = true
|
||||
rescue
|
||||
ensure
|
||||
if w
|
||||
w.quit
|
||||
w.quit(Word::WdDoNotSaveChanges)
|
||||
w = nil
|
||||
end
|
||||
end
|
||||
|
@ -59,7 +64,7 @@ if defined?(WIN32OLE)
|
|||
|
||||
def teardown
|
||||
if @obj
|
||||
@obj.quit
|
||||
@obj.quit(Word::WdDoNotSaveChanges)
|
||||
@obj = nil
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue