summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorsuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-07 13:17:22 +0000
committersuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-07 13:17:22 +0000
commitd9bc7904faa60f67886d86f2bb49ec4b54ae9cf5 (patch)
treeea77514d1ddd15951f9b7bc102a5da06713b70a8 /test
parent034e38d8a2de9bfd82438fab0c0dc6eaa1335d7f (diff)
* test/win32ole/test_win32ole_record.rb: remove test using .NET
Framework 3.5 because it is not included in Windows 8/8.1. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/win32ole/test_win32ole_record.rb102
1 files changed, 0 insertions, 102 deletions
diff --git a/test/win32ole/test_win32ole_record.rb b/test/win32ole/test_win32ole_record.rb
index 4d9da4b..e32a9e2 100644
--- a/test/win32ole/test_win32ole_record.rb
+++ b/test/win32ole/test_win32ole_record.rb
@@ -6,7 +6,6 @@ rescue LoadError
end
require 'test/unit'
-PROGID_CLR='System.Runtime.Serialization.FormatterConverter'
PROGID_RBCOMTEST='RbComTest.ComSrvTest'
=begin
@@ -210,105 +209,4 @@ if defined?(WIN32OLE_RECORD)
end
end
- def clr_exist?
- exist = false
- begin
- obj = WIN32OLE.new(PROGID_CLR)
- exist = true
- rescue WIN32OLERuntimeError
- exist = false
- end
- exist
- end
-
- class TestWIN32OLE_CLR < Test::Unit::TestCase
- unless clr_exist?
- def test_dummy_for_skip_message
- skip "#{PROGID_CLR}(.Net Framework 3.5) not found."
- end
- else
- def setup
- @obj = WIN32OLE.new(PROGID_CLR)
- end
-
- def test_s_new_from_win32ole
- rec = WIN32OLE_RECORD.new('Decimal', @obj)
- assert(rec)
- assert_instance_of(WIN32OLE_RECORD, rec)
- end
-
- def test_s_new_from_win32ole_typelib
- tlib = @obj.ole_typelib
- rec = WIN32OLE_RECORD.new('Decimal', tlib)
- assert(rec)
- assert_instance_of(WIN32OLE_RECORD, rec)
- end
-
- def test_s_new_raise
- assert_raise(WIN32OLERuntimeError) {
- rec = WIN32OLE_RECORD.new('NonExistRecordName', @obj)
- }
- assert_raise(ArgumentError) {
- rec = WIN32OLE_RECORD.new
- }
- assert_raise(ArgumentError) {
- rec = WIN32OLE_RECORD.new('NonExistRecordName')
- }
- end
-
- def test_to_h
- rec = WIN32OLE_RECORD.new('Decimal', @obj)
- assert_equal({'lo'=>nil, 'mid'=>nil, 'hi'=>nil, 'flags'=>nil}, rec.to_h)
- end
-
- def test_typename
- rec = WIN32OLE_RECORD.new('Decimal', @obj)
- assert_equal('Decimal', rec.typename)
- end
-
- def test_method_missing_getter
- rec = WIN32OLE_RECORD.new('Decimal', @obj)
- assert_equal(nil, rec.lo)
- assert_raise(KeyError) {
- rec.non_exist_name
- }
- end
-
- def test_method_missing_setter
- rec = WIN32OLE_RECORD.new('Decimal', @obj)
- rec.lo = 1
- assert_equal(1, rec.lo)
- end
-
- def test_pass_record_parameter
- rec = WIN32OLE_RECORD.new('Decimal', @obj)
- rec.lo = 0
- rec.mid = 1
- rec.hi = 0
- rec.flags = false
- assert_equal(2**32, @obj.ToInt64(rec))
- end
-
- def test_ole_instance_variable_get
- obj = WIN32OLE_RECORD.new('Decimal', @obj)
- assert_equal(nil, obj.ole_instance_variable_get(:lo))
- assert_equal(nil, obj.ole_instance_variable_get('lo'))
- end
-
- def test_ole_instance_variable_set
- rec = WIN32OLE_RECORD.new('Decimal', @obj)
- rec.ole_instance_variable_set(:lo, 1)
- assert_equal(1, rec.lo)
- rec.ole_instance_variable_set('lo', 2)
- assert_equal(2, rec.lo)
- end
-
- def test_inspect
- rec = WIN32OLE_RECORD.new('Decimal', @obj)
- assert_equal(%q[#<WIN32OLE_RECORD(Decimal) {"flags"=>nil, "hi"=>nil, "lo"=>nil, "mid"=>nil}>], rec.inspect)
- end
-
- end
- end
-
end