mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
34 lines
967 B
Ruby
34 lines
967 B
Ruby
require_relative '../fixtures/classes'
|
|
|
|
platform_is :windows do
|
|
require 'win32ole'
|
|
|
|
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
|