HEX
Server: Apache
System: Linux s198.coreserver.jp 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025 x86_64
User: nagasaki (10062)
PHP: 7.1.33
Disabled: NONE
Upload Files
File: //usr/local/rvm/src/ruby-2.7.4/spec/ruby/library/win32ole/win32ole/const_load_spec.rb
platform_is :windows do
  require_relative '../fixtures/classes'

  describe "WIN32OLE.const_load when passed Shell.Application OLE object" do
    before :each do
      @win32ole = WIN32OLESpecs.new_ole 'Shell.Application'
    end

    it "loads constant SsfWINDOWS into WIN32OLE namespace" do
      WIN32OLE.const_defined?(:SsfWINDOWS).should be_false
      WIN32OLE.const_load @win32ole
      WIN32OLE.const_defined?(:SsfWINDOWS).should be_true
    end
  end

  describe "WIN32OLE.const_load when namespace is specified" do
    before :each do
      module WIN32OLE_RUBYSPEC; end
      @win32ole = WIN32OLESpecs.new_ole 'Shell.Application'
    end

    it "loads constants into given namespace" do
      module WIN32OLE_RUBYSPEC; end

      WIN32OLE_RUBYSPEC.const_defined?(:SsfWINDOWS).should be_false
      WIN32OLE.const_load @win32ole, WIN32OLE_RUBYSPEC
      WIN32OLE_RUBYSPEC.const_defined?(:SsfWINDOWS).should be_true

    end
  end

end