ruby-oci8 1.0.7-x86-mswin32-60 → 2.0.1-x86-mswin32-60

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. data/ChangeLog +1289 -383
  2. data/Makefile +48 -12
  3. data/NEWS +5 -419
  4. data/README +56 -385
  5. data/VERSION +1 -1
  6. data/dist-files +27 -27
  7. data/lib/.document +2 -0
  8. data/lib/dbd/OCI8.rb +2 -17
  9. data/lib/oci8.rb +48 -1622
  10. data/lib/oci8.rb.in +48 -1622
  11. data/lib/oci8/.document +5 -0
  12. data/lib/oci8/compat.rb +108 -0
  13. data/lib/oci8/datetime.rb +491 -0
  14. data/lib/oci8/encoding-init.rb +40 -0
  15. data/lib/oci8/encoding.yml +537 -0
  16. data/lib/oci8/metadata.rb +2077 -0
  17. data/lib/oci8/object.rb +548 -0
  18. data/lib/oci8/oci8.rb +798 -0
  19. data/lib/oci8/oracle_version.rb +144 -0
  20. data/lib/oci8lib_18.so +0 -0
  21. data/lib/oci8lib_191.so +0 -0
  22. data/metaconfig +3 -3
  23. data/ruby-oci8.gemspec +24 -15
  24. data/setup.rb +4 -4
  25. data/test/config.rb +64 -84
  26. data/test/test_all.rb +14 -21
  27. data/test/test_array_dml.rb +333 -0
  28. data/test/test_bind_raw.rb +18 -25
  29. data/test/test_bind_time.rb +78 -91
  30. data/test/test_break.rb +37 -35
  31. data/test/test_clob.rb +33 -89
  32. data/test/test_connstr.rb +5 -4
  33. data/test/test_datetime.rb +469 -0
  34. data/test/test_dbi.rb +99 -60
  35. data/test/test_dbi_clob.rb +3 -8
  36. data/test/test_metadata.rb +65 -51
  37. data/test/test_oci8.rb +151 -55
  38. data/test/test_oracle_version.rb +70 -0
  39. data/test/test_oradate.rb +76 -83
  40. data/test/test_oranumber.rb +405 -71
  41. data/test/test_rowid.rb +6 -11
  42. metadata +21 -25
  43. data/ext/oci8/oci8lib.so +0 -0
  44. data/ruby-oci8.spec +0 -62
  45. data/support/README +0 -4
  46. data/support/runit/assert.rb +0 -281
  47. data/support/runit/cui/testrunner.rb +0 -101
  48. data/support/runit/error.rb +0 -4
  49. data/support/runit/method_mappable.rb +0 -20
  50. data/support/runit/robserver.rb +0 -25
  51. data/support/runit/setuppable.rb +0 -15
  52. data/support/runit/teardownable.rb +0 -16
  53. data/support/runit/testcase.rb +0 -113
  54. data/support/runit/testfailure.rb +0 -25
  55. data/support/runit/testresult.rb +0 -121
  56. data/support/runit/testsuite.rb +0 -43
  57. data/support/runit/version.rb +0 -3
  58. data/test/test_describe.rb +0 -137
@@ -1,101 +0,0 @@
1
- require 'runit/testresult'
2
- require 'runit/robserver'
3
-
4
- module RUNIT
5
- module CUI
6
- class TestRunner
7
- include RObserver
8
- @@quiet_mode = false
9
- def initialize(io=STDERR, wait=false)
10
- @io = io
11
- @wait = wait
12
- end
13
-
14
- def TestRunner.quiet_mode=(flag)
15
- @@quiet_mode = flag
16
- end
17
-
18
- def TestRunner.run(test, io=STDERR, wait = false)
19
- r = TestRunner.new(io, wait)
20
- r.run(test)
21
- end
22
-
23
- def run(test)
24
- result = RUNIT::TestResult.new
25
- result.add_observer(self)
26
- test.run(result)
27
- print_running_time(result.running_time)
28
- print_result(result, test.count_test_cases)
29
- print_waiting_message
30
- result
31
- end
32
-
33
- def print_waiting_message
34
- if @wait
35
- STDERR.print "<RETURN> to Continue "
36
- STDIN.gets
37
- end
38
- end
39
-
40
- def print_running_time(rtm)
41
- @io.print "\nTime: #{rtm}\n"
42
- end
43
-
44
- def start_test(t)
45
- @io.print "\n", t.name , " " if !@@quiet_mode
46
- end
47
-
48
- def add_failure(at, err)
49
- @io.print("F")
50
- end
51
-
52
- def add_error(at, err)
53
- @io.print("E")
54
- end
55
-
56
- def end_test(t)
57
- @io.print(".")
58
- end
59
-
60
- def print_result(result, count)
61
- print_header(result, count)
62
- print_failures(result)
63
- print_errors(result)
64
- end
65
-
66
- def print_header(result, count)
67
- if result.succeed?
68
- @io.puts "OK (#{result.run_tests}/#{count} tests #{result.run_asserts} asserts)"
69
- else
70
- @io.puts "FAILURES!!!"
71
- @io.puts "Test Results:"
72
- @io.print " Run: #{result.run_tests}/#{count}(#{result.run_asserts} asserts)"
73
- @io.print " Failures: #{result.failure_size}"
74
- @io.puts " Errors: #{result.error_size}"
75
- end
76
- end
77
-
78
- def print_failures(result)
79
- @io.puts "Failures: #{result.failure_size}" if result.failure_size > 0
80
- result.failures.each do |f|
81
- @io.print f.at[0], ": ", f.err, " (", f.err.class, ")\n"
82
- for at in f.at[1..-1]
83
- @io.print "\tfrom ", at, "\n"
84
- end
85
- end
86
- end
87
-
88
- def print_errors(result)
89
- @io.puts "Errors: #{result.error_size}" if result.error_size > 0
90
- result.errors.each do |e|
91
- @io.print e.at[0], ": ", e.err, " (", e.err.class, ")\n"
92
- for at in e.at[1..-1]
93
- @io.print "\tfrom ", at, "\n"
94
- end
95
- end
96
- end
97
-
98
- end
99
- end
100
- end
101
-
@@ -1,4 +0,0 @@
1
- module RUNIT
2
- class AssertionFailedError < StandardError
3
- end
4
- end
@@ -1,20 +0,0 @@
1
- module RUNIT
2
- module MethodMappable
3
- def attach_method(hash, method, *methods)
4
- methods.each do |m|
5
- hash[self.to_s + m.to_s] = method
6
- end
7
- end
8
- private :attach_method
9
-
10
- def invoke_method(hash, m)
11
- if hash[self.to_s + m.to_s]
12
- send hash[self.to_s + m.to_s]
13
- elsif hash[self.class.to_s + m.to_s]
14
- send hash[self.class.to_s + m.to_s]
15
- end
16
- end
17
- private :invoke_method
18
- end
19
- end
20
-
@@ -1,25 +0,0 @@
1
- module RUNIT
2
- module RObserver
3
- ADD_ERROR = :add_error
4
- ADD_FAILURE = :add_failure
5
- START_TEST = :start_test
6
- END_TEST = :end_test
7
-
8
- def add_error(*arg)
9
- end
10
-
11
- def add_failure(*arg)
12
- end
13
-
14
- def start_test(*arg)
15
- end
16
-
17
- def end_test(*arg)
18
- end
19
-
20
- def update(ev, *arg)
21
- send(ev, *arg)
22
- end
23
-
24
- end
25
- end
@@ -1,15 +0,0 @@
1
- require 'runit/method_mappable'
2
- module RUNIT
3
- module Setuppable
4
- include MethodMappable
5
- @@setups = {}
6
- def attach_setup(setup_method, *methods)
7
- attach_method(@@setups, setup_method, *methods)
8
- end
9
- private :attach_setup
10
- def invoke_setup(m)
11
- invoke_method(@@setups, m)
12
- end
13
- private :invoke_setup
14
- end
15
- end
@@ -1,16 +0,0 @@
1
- require 'runit/method_mappable'
2
- module RUNIT
3
- module Teardownable
4
- include MethodMappable
5
- @@teardowns = {}
6
- def attach_teardown(teardown_method, *methods)
7
- attach_method(@@teardowns, teardown_method, *methods)
8
- end
9
- private :attach_teardown
10
- def invoke_teardown(m)
11
- invoke_method(@@teardowns, m)
12
- end
13
- private :invoke_teardown
14
- end
15
- end
16
-
@@ -1,113 +0,0 @@
1
- require 'observer'
2
- require 'runit/testsuite'
3
- require 'runit/robserver'
4
- require 'runit/error'
5
- require 'runit/assert'
6
- require 'runit/setuppable'
7
- require 'runit/teardownable'
8
-
9
- module RUNIT
10
- class TestCase
11
- alias_method :extend_test, :extend
12
-
13
- include Assert
14
- include Observable
15
-
16
- include Setuppable
17
- extend Setuppable
18
- include Teardownable
19
- extend Teardownable
20
-
21
- @@test_classes = []
22
-
23
- def initialize(method, name=self.class.name)
24
- @method = method
25
- @name = name
26
- end
27
-
28
- def setup
29
- end
30
- private :setup
31
-
32
- def teardown
33
- end
34
- private :teardown
35
-
36
- def name
37
- @name + "#" + @method
38
- end
39
-
40
- def method_name
41
- @method
42
- end
43
-
44
- def count_test_cases
45
- 1
46
- end
47
-
48
- def run(result)
49
- result.start_test(self)
50
- begin
51
- run_bare
52
- rescue AssertionFailedError
53
- result.add_failure($@, $!, self.class)
54
- rescue StandardError, ScriptError
55
- result.add_error($@, $!, self.class)
56
- end
57
- result.end_test(self)
58
- end
59
-
60
- def run_bare
61
- setup
62
- invoke_setup(@method)
63
- begin
64
- send(@method)
65
- ensure
66
- begin
67
- invoke_teardown(@method)
68
- teardown
69
- rescue
70
- changed
71
- notify_observers(RObserver::ADD_ERROR, $@, $!, self.class)
72
- end
73
- end
74
- end
75
-
76
- def ==(other)
77
- other.class == self.class && other.method_name && self.method_name
78
- end
79
-
80
- def TestCase.suite
81
- TestSuite.new(self_test_cases)
82
- end
83
-
84
- def TestCase.inherited(sub)
85
- @@test_classes.push sub
86
- end
87
-
88
- def TestCase.self_test_cases
89
- instance_methods(true).sort.collect {|m|
90
- new(m, name) if /^test/ =~ m
91
- }.compact
92
- end
93
-
94
- def TestCase.test_cases
95
- if self == TestCase
96
- TestSuite.new(*@@test_classes)
97
- else
98
- suite
99
- end
100
- end
101
-
102
-
103
- class<<TestCase
104
- alias test_methods test_cases
105
- alias all_suite test_cases
106
- private :self_test_cases
107
- end
108
-
109
- def TestCase.test_classes
110
- @@test_classes
111
- end
112
- end
113
- end
@@ -1,25 +0,0 @@
1
- module RUNIT
2
- SKIP_FILES = $:.collect{|path| /#{path}\/runit\//}.push /\/rubyunit\.rb:/
3
-
4
- class TestFailure
5
- attr_reader :at, :err
6
- def initialize(at, err, testclass)
7
- skip_trace = at.reject{|i|
8
- SKIP_FILES.find {|pat|
9
- pat =~ i
10
- }
11
- }
12
- @at = insert_class_name(skip_trace, testclass)
13
- @err = err
14
- end
15
- def to_s
16
- "#{@at[0]} #{@err}(#{@err.type})"
17
- end
18
- def insert_class_name(last_exception_backtrace, testclass)
19
- tns = testclass.inspect.split("::")
20
- last_exception_backtrace[0] += "(" + tns[tns.length-1] + ")"
21
- last_exception_backtrace
22
- end
23
- private :insert_class_name
24
- end
25
- end
@@ -1,121 +0,0 @@
1
- require 'observer'
2
- require 'runit/error'
3
- require 'runit/robserver'
4
- require 'runit/testfailure'
5
-
6
- module RUNIT
7
- class TestResultItem
8
- attr_reader :name
9
- attr_reader :failures
10
- attr_reader :errors
11
- attr_accessor :run_asserts
12
-
13
- def initialize(name)
14
- @failures = []
15
- @errors = []
16
- @name = name
17
- @run_asserts = 0
18
- end
19
-
20
- def add_failure(failure)
21
- @failures.push failure
22
- end
23
-
24
- def add_error(error)
25
- @errors.push error
26
- end
27
- end
28
-
29
- class TestResult
30
- include Observable
31
- include RObserver
32
-
33
- def initialize
34
- @result = nil
35
- @results = []
36
- @test_start_time = nil
37
- @test_end_time = nil
38
- @start_assert_size = 0
39
- end
40
-
41
- def items
42
- @results
43
- end
44
-
45
- def run_tests
46
- @results.size
47
- end
48
-
49
- def add_failure(at, err, testclass)
50
- fail = TestFailure.new(at, err, testclass)
51
- @result.add_failure(fail)
52
- changed
53
- notify_observers(RObserver::ADD_FAILURE, at, err)
54
- end
55
-
56
- def add_error(at, err, testclass)
57
- error = TestFailure.new(at, err, testclass)
58
- @result.add_error(error)
59
- changed
60
- notify_observers(RObserver::ADD_ERROR, at, err)
61
- end
62
-
63
- def assert_size
64
- size = 0
65
- @results.each do |i|
66
- size += i.run_asserts
67
- end
68
- size
69
- end
70
- alias run_asserts assert_size
71
-
72
- def failure_size
73
- failures.size
74
- end
75
-
76
- def error_size
77
- errors.size
78
- end
79
-
80
- def failures
81
- @results.collect{|r|
82
- r.failures
83
- }.flatten
84
- end
85
-
86
- def errors
87
- @results.collect{|r|
88
- r.errors
89
- }.flatten
90
- end
91
-
92
- def succeed?
93
- failure_size == 0 && error_size == 0
94
- end
95
-
96
- def running_time
97
- if @test_end_time && @test_start_time
98
- @test_end_time - @test_start_time
99
- else
100
- 0
101
- end
102
- end
103
-
104
- def start_test(testcase)
105
- testcase.add_observer(self)
106
- @result = TestResultItem.new(testcase.name)
107
- @results.push @result
108
- @start_assert_size = Assert.run_asserts
109
- @test_start_time = Time.now if !@test_start_time
110
- changed
111
- notify_observers(RObserver::START_TEST, testcase)
112
- end
113
-
114
- def end_test(testcase)
115
- changed
116
- notify_observers(RObserver::END_TEST, testcase)
117
- @test_end_time = Time.now
118
- @result.run_asserts = Assert.run_asserts - @start_assert_size
119
- end
120
- end
121
- end