diff options
Diffstat (limited to 'spec/ruby/library/win32ole/win32ole_variable')
9 files changed, 152 insertions, 0 deletions
diff --git a/spec/ruby/library/win32ole/win32ole_variable/name_spec.rb b/spec/ruby/library/win32ole/win32ole_variable/name_spec.rb new file mode 100644 index 0000000000..724fd5c70a --- /dev/null +++ b/spec/ruby/library/win32ole/win32ole_variable/name_spec.rb @@ -0,0 +1,11 @@ +require File.expand_path('../shared/name', __FILE__) + +platform_is :windows do + require 'win32ole' + + describe "WIN32OLE_VARIABLE#name" do + it_behaves_like :win32ole_variable_new, :name + + end + +end diff --git a/spec/ruby/library/win32ole/win32ole_variable/ole_type_detail_spec.rb b/spec/ruby/library/win32ole/win32ole_variable/ole_type_detail_spec.rb new file mode 100644 index 0000000000..dab4edabaa --- /dev/null +++ b/spec/ruby/library/win32ole/win32ole_variable/ole_type_detail_spec.rb @@ -0,0 +1,19 @@ +platform_is :windows do + require 'win32ole' + + describe "WIN32OLE_VARIABLE#ole_type_detail" do + # not sure how WIN32OLE_VARIABLE objects are supposed to be generated + # WIN32OLE_VARIABLE.new even seg faults in some cases + before :each do + ole_type = WIN32OLE_TYPE.new("Microsoft Shell Controls And Automation", "ShellSpecialFolderConstants") + @var = ole_type.variables[0] + end + + it "returns a nonempty Array" do + @var.ole_type_detail.should be_kind_of Array + @var.ole_type_detail.should_not be_empty + end + + end + +end diff --git a/spec/ruby/library/win32ole/win32ole_variable/ole_type_spec.rb b/spec/ruby/library/win32ole/win32ole_variable/ole_type_spec.rb new file mode 100644 index 0000000000..d08acc9bde --- /dev/null +++ b/spec/ruby/library/win32ole/win32ole_variable/ole_type_spec.rb @@ -0,0 +1,18 @@ +platform_is :windows do + require 'win32ole' + + describe "WIN32OLE_VARIABLE#ole_type" do + # not sure how WIN32OLE_VARIABLE objects are supposed to be generated + # WIN32OLE_VARIABLE.new even seg faults in some cases + before :each do + ole_type = WIN32OLE_TYPE.new("Microsoft Shell Controls And Automation", "ShellSpecialFolderConstants") + @var = ole_type.variables[0] + end + + it "returns a String" do + @var.ole_type.should be_kind_of String + end + + end + +end diff --git a/spec/ruby/library/win32ole/win32ole_variable/shared/name.rb b/spec/ruby/library/win32ole/win32ole_variable/shared/name.rb new file mode 100644 index 0000000000..033e830fac --- /dev/null +++ b/spec/ruby/library/win32ole/win32ole_variable/shared/name.rb @@ -0,0 +1,18 @@ +platform_is :windows do + require 'win32ole' + + describe :win32ole_variable_new, shared: true do + # not sure how WIN32OLE_VARIABLE objects are supposed to be generated + # WIN32OLE_VARIABLE.new even seg faults in some cases + before :each do + ole_type = WIN32OLE_TYPE.new("Microsoft Shell Controls And Automation", "ShellSpecialFolderConstants") + @var = ole_type.variables[0] + end + + it "returns a String" do + @var.send(@method).should be_kind_of String + end + + end + +end diff --git a/spec/ruby/library/win32ole/win32ole_variable/to_s_spec.rb b/spec/ruby/library/win32ole/win32ole_variable/to_s_spec.rb new file mode 100644 index 0000000000..9853f91801 --- /dev/null +++ b/spec/ruby/library/win32ole/win32ole_variable/to_s_spec.rb @@ -0,0 +1,11 @@ +require File.expand_path('../shared/name', __FILE__) + +platform_is :windows do + require 'win32ole' + + describe "WIN32OLE_VARIABLE#to_s" do + it_behaves_like :win32ole_variable_new, :to_s + + end + +end diff --git a/spec/ruby/library/win32ole/win32ole_variable/value_spec.rb b/spec/ruby/library/win32ole/win32ole_variable/value_spec.rb new file mode 100644 index 0000000000..c15f64c2c5 --- /dev/null +++ b/spec/ruby/library/win32ole/win32ole_variable/value_spec.rb @@ -0,0 +1,19 @@ +platform_is :windows do + require 'win32ole' + + describe "WIN32OLE_VARIABLE#value" do + # not sure how WIN32OLE_VARIABLE objects are supposed to be generated + # WIN32OLE_VARIABLE.new even seg faults in some cases + before :each do + ole_type = WIN32OLE_TYPE.new("Microsoft Shell Controls And Automation", "ShellSpecialFolderConstants") + @var = ole_type.variables[0] + end + + it "returns a Integer" do + # according to doc, this could return nil + @var.value.should be_kind_of Integer + end + + end + +end diff --git a/spec/ruby/library/win32ole/win32ole_variable/variable_kind_spec.rb b/spec/ruby/library/win32ole/win32ole_variable/variable_kind_spec.rb new file mode 100644 index 0000000000..4cca7f8874 --- /dev/null +++ b/spec/ruby/library/win32ole/win32ole_variable/variable_kind_spec.rb @@ -0,0 +1,19 @@ +platform_is :windows do + require 'win32ole' + + describe "WIN32OLE_VARIABLE#variable_kind" do + # not sure how WIN32OLE_VARIABLE objects are supposed to be generated + # WIN32OLE_VARIABLE.new even seg faults in some cases + before :each do + ole_type = WIN32OLE_TYPE.new("Microsoft Shell Controls And Automation", "ShellSpecialFolderConstants") + @var = ole_type.variables[0] + end + + it "returns a String" do + @var.variable_kind.should be_kind_of String + @var.variable_kind.should == 'CONSTANT' + end + + end + +end diff --git a/spec/ruby/library/win32ole/win32ole_variable/varkind_spec.rb b/spec/ruby/library/win32ole/win32ole_variable/varkind_spec.rb new file mode 100644 index 0000000000..56cd1c337a --- /dev/null +++ b/spec/ruby/library/win32ole/win32ole_variable/varkind_spec.rb @@ -0,0 +1,19 @@ +platform_is :windows do + require 'win32ole' + + describe "WIN32OLE_VARIABLE#varkind" do + # TODO review + # not sure how WIN32OLE_VARIABLE objects are supposed to be generated + # WIN32OLE_VARIABLE.new even seg faults in some cases + before :each do + ole_type = WIN32OLE_TYPE.new("Microsoft Shell Controls And Automation", "ShellSpecialFolderConstants") + @var = ole_type.variables[0] + end + + it "returns an Integer" do + @var.varkind.should be_kind_of Integer + end + + end + +end diff --git a/spec/ruby/library/win32ole/win32ole_variable/visible_spec.rb b/spec/ruby/library/win32ole/win32ole_variable/visible_spec.rb new file mode 100644 index 0000000000..7f7a557b57 --- /dev/null +++ b/spec/ruby/library/win32ole/win32ole_variable/visible_spec.rb @@ -0,0 +1,18 @@ +platform_is :windows do + require 'win32ole' + + describe "WIN32OLE_VARIABLE#visible?" do + # not sure how WIN32OLE_VARIABLE objects are supposed to be generated + # WIN32OLE_VARIABLE.new even seg faults in some cases + before :each do + ole_type = WIN32OLE_TYPE.new("Microsoft Shell Controls And Automation", "ShellSpecialFolderConstants") + @var = ole_type.variables[0] + end + + it "returns a String" do + @var.visible?.should be_true + end + + end + +end |