Issue #14085 has been updated by suke (Masaki Suketa).


#13984 で入れたんですけど、一旦、戻しましょうか。

WIN32OLEから定数を取得するときに、Wordサーバから複数回、同じ定数を返されるので、そうなるんですよね。
warningの対策は別で考えるとして。

----------------------------------------
Bug #14085: many redefinition warnings on test/win32ole/test_word.rb
https://bugs.ruby-lang.org/issues/14085#change-67721

* Author: usa (Usaku NAKAMURA)
* Status: Assigned
* Priority: Normal
* Assignee: suke (Masaki Suketa)
* Target version: 
* ruby -v: ruby 2.5.0dev (2017-11-06 trunk 60666) [x64-mswin64_100]
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
win32oleのテストで、以下のような警告が出ます。
警告が出るのは `WIN32OLE.const_load(w, Word)` というコードですが、
該当コードが複数回呼ばれているわけではなくて、これを1回呼ぶだけで、
定数の再定義が何度も行われてしまうようです。
実害はないような気もしますが、できれば出ないようにできないでしょうか?

    D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: already initialized constant Word::Emptyenum
    D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: previous definition of Emptyenum was here
    D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: already initialized constant Word::Emptyenum
    D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: previous definition of Emptyenum was here
    D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: already initialized constant Word::Emptyenum
    D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: previous definition of Emptyenum was here
    D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: already initialized constant Word::Emptyenum
    D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: previous definition of Emptyenum was here
    D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: already initialized constant Word::Emptyenum
    D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: previous definition of Emptyenum was here
    D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: already initialized constant Word::Emptyenum
    D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: previous definition of Emptyenum was here
    D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: already initialized constant Word::Emptyenum
    D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: previous definition of Emptyenum was here
    D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: already initialized constant Word::Emptyenum
    D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: previous definition of Emptyenum was here
    D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: already initialized constant Word::Emptyenum
    D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: previous definition of Emptyenum was here
    D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: already initialized constant Word::Emptyenum
    D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: previous definition of Emptyenum was here
    D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: already initialized constant Word::Emptyenum
    D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: previous definition of Emptyenum was here
    D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: already initialized constant Word::Emptyenum
    D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: previous definition of Emptyenum was here
    D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: already initialized constant Word::Emptyenum
    D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: previous definition of Emptyenum was here
    D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: already initialized constant Word::Emptyenum
    D:/Users/usa/ruby/test/win32ole/test_word.rb:22: warning: previous definition of Emptyenum was here




-- 
https://bugs.ruby-lang.org/