[ruby-oci8-commit] [570] trunk/ruby-oci8/test: Use MiniTest instead of Test::Unit.

nobody at rubyforge.org nobody at rubyforge.org
Mon Jul 15 05:39:32 UTC 2013


Revision: 570
Author:   kubo
Date:     2013-07-15 05:39:30 +0000 (Mon, 15 Jul 2013)
Log Message:
-----------
Use MiniTest instead of Test::Unit.

Modified Paths:
--------------
    trunk/ruby-oci8/test/config.rb
    trunk/ruby-oci8/test/test_all.rb
    trunk/ruby-oci8/test/test_appinfo.rb
    trunk/ruby-oci8/test/test_array_dml.rb
    trunk/ruby-oci8/test/test_bind_raw.rb
    trunk/ruby-oci8/test/test_bind_string.rb
    trunk/ruby-oci8/test/test_bind_time.rb
    trunk/ruby-oci8/test/test_break.rb
    trunk/ruby-oci8/test/test_clob.rb
    trunk/ruby-oci8/test/test_connection_pool.rb
    trunk/ruby-oci8/test/test_connstr.rb
    trunk/ruby-oci8/test/test_datetime.rb
    trunk/ruby-oci8/test/test_dbi.rb
    trunk/ruby-oci8/test/test_dbi_clob.rb
    trunk/ruby-oci8/test/test_encoding.rb
    trunk/ruby-oci8/test/test_error.rb
    trunk/ruby-oci8/test/test_metadata.rb
    trunk/ruby-oci8/test/test_object.rb
    trunk/ruby-oci8/test/test_oci8.rb
    trunk/ruby-oci8/test/test_oracle_version.rb
    trunk/ruby-oci8/test/test_oradate.rb
    trunk/ruby-oci8/test/test_oranumber.rb
    trunk/ruby-oci8/test/test_rowid.rb

Modified: trunk/ruby-oci8/test/config.rb
===================================================================
--- trunk/ruby-oci8/test/config.rb	2013-06-23 09:40:55 UTC (rev 569)
+++ trunk/ruby-oci8/test/config.rb	2013-07-15 05:39:30 UTC (rev 570)
@@ -18,6 +18,19 @@
 
 # don't modify below.
 
+begin
+  require 'minitest/autorun'
+rescue LoadError
+  require 'test/unit'
+  MiniTest = Test
+  module Test
+    Assertions = Unit::Assertions
+    module Assertions
+      alias refute_nil assert_not_nil
+    end
+  end
+end
+
 # $oracle_server_version: database compatible level of the Oracle server.
 # $oracle_client_version: Oracle client library version for which oci8 is compiled.
 # $oracle_version: lower value of $oracle_server_version and $oracle_client_version.
@@ -108,77 +121,72 @@
   end
 end
 
-module Test
-  module Unit
-    class TestCase
+class MiniTest::Unit::TestCase
 
-      def get_oci8_connection()
-        OCI8.new($dbuser, $dbpass, $dbname)
+  def get_oci8_connection()
+    OCI8.new($dbuser, $dbpass, $dbname)
       rescue OCIError
-        raise if $!.code != 12516 && $!.code != 12520
-        # sleep a few second and try again if
-        # the error code is ORA-12516 or ORA-12520.
-        #
-        # ORA-12516 - TNS:listener could not find available handler with
-        #             matching protocol stack
-        # ORA-12520 - TNS:listener could not find available handler for
-        #             requested type of server
-        #
-        # Thanks to Christopher Jones.
-        #
-        # Ref: The Underground PHP and Oracle Manual (page 175 in vesion 1.4)
-        #      http://www.oracle.com/technology/tech/php/pdf/underground-php-oracle-manual.pdf
-        #
-        sleep(5)
-        OCI8.new($dbuser, $dbpass, $dbname)
+    raise if $!.code != 12516 && $!.code != 12520
+    # sleep a few second and try again if
+    # the error code is ORA-12516 or ORA-12520.
+    #
+    # ORA-12516 - TNS:listener could not find available handler with
+    #             matching protocol stack
+    # ORA-12520 - TNS:listener could not find available handler for
+    #             requested type of server
+    #
+    # Thanks to Christopher Jones.
+    #
+    # Ref: The Underground PHP and Oracle Manual (page 175 in vesion 1.4)
+    #      http://www.oracle.com/technology/tech/php/pdf/underground-php-oracle-manual.pdf
+    #
+    sleep(5)
+    OCI8.new($dbuser, $dbpass, $dbname)
+  end
+
+  def get_dbi_connection()
+    DBI.connect("dbi:OCI8:#{$dbname}", $dbuser, $dbpass, 'AutoCommit' => false)
+  rescue DBI::DatabaseError
+    raise if $!.err != 12516 && $!.err != 12520
+    # same as get_oci8_connection()
+    sleep(5)
+    DBI.connect("dbi:OCI8:#{$dbname}", $dbuser, $dbpass, 'AutoCommit' => false)
+  end
+
+  def drop_table(table_name)
+    if $oracle_server_version < OCI8::ORAVER_10_1
+      # Oracle 8 - 9i
+      sql = "DROP TABLE #{table_name}"
+    else
+      # Oracle 10g -
+      sql = "DROP TABLE #{table_name} PURGE"
+    end
+
+    if defined? @conn
+      begin
+        @conn.exec(sql)
+      rescue OCIError
+        raise if $!.code != 942 # table or view does not exist
       end
-
-      def get_dbi_connection()
-        DBI.connect("dbi:OCI8:#{$dbname}", $dbuser, $dbpass, 'AutoCommit' => false)
+    elsif instance_variable_get(:@dbh)
+      begin
+        @dbh.do(sql)
       rescue DBI::DatabaseError
-        raise if $!.err != 12516 && $!.err != 12520
-        # same as get_oci8_connection()
-        sleep(5)
-        DBI.connect("dbi:OCI8:#{$dbname}", $dbuser, $dbpass, 'AutoCommit' => false)
+        raise if $!.err != 942 # table or view does not exist
       end
+    end
+  end # drop_table
 
-      def drop_table(table_name)
-        if $oracle_server_version < OCI8::ORAVER_10_1
-          # Oracle 8 - 9i
-          sql = "DROP TABLE #{table_name}"
-        else
-          # Oracle 10g -
-          sql = "DROP TABLE #{table_name} PURGE"
-        end
-
-        if defined? @conn
-          begin
-            @conn.exec(sql)
-          rescue OCIError
-            raise if $!.code != 942 # table or view does not exist
-          end
-        elsif instance_variable_get(:@dbh)
-          begin
-            @dbh.do(sql)
-          rescue DBI::DatabaseError
-            raise if $!.err != 942 # table or view does not exist
-          end
-        end
-      end # drop_table
-
-      def drop_type(type_name)
-        begin
-          @conn.exec("DROP TYPE BODY #{type_name}")
-        rescue OCIError
-          raise if $!.code != 4043
-        end
-        begin
-          @conn.exec("DROP TYPE #{type_name}")
-        rescue OCIError
-          raise if $!.code != 4043
-        end
-      end # drop_type
+  def drop_type(type_name)
+    begin
+      @conn.exec("DROP TYPE BODY #{type_name}")
+    rescue OCIError
+      raise if $!.code != 4043
     end
-  end
+    begin
+      @conn.exec("DROP TYPE #{type_name}")
+    rescue OCIError
+      raise if $!.code != 4043
+    end
+  end # drop_type
 end
-

Modified: trunk/ruby-oci8/test/test_all.rb
===================================================================
--- trunk/ruby-oci8/test/test_all.rb	2013-06-23 09:40:55 UTC (rev 569)
+++ trunk/ruby-oci8/test/test_all.rb	2013-07-15 05:39:30 UTC (rev 570)
@@ -1,7 +1,6 @@
 srcdir = File.dirname(__FILE__)
 
 require 'oci8'
-require 'test/unit'
 require "#{srcdir}/config"
 
 require "#{srcdir}/test_oradate"
@@ -47,8 +46,3 @@
     require "#{srcdir}/test_dbi_clob"
   end
 end
-
-#Test::Unit::AutoRunner.run(true, true)
-if defined? Test::Unit::AutoRunner
-  Test::Unit::AutoRunner.run()
-end

Modified: trunk/ruby-oci8/test/test_appinfo.rb
===================================================================
--- trunk/ruby-oci8/test/test_appinfo.rb	2013-06-23 09:40:55 UTC (rev 569)
+++ trunk/ruby-oci8/test/test_appinfo.rb	2013-07-15 05:39:30 UTC (rev 570)
@@ -1,8 +1,7 @@
 require 'oci8'
-require 'test/unit'
 require File.dirname(__FILE__) + '/config'
 
-class TestAppInfo < Test::Unit::TestCase
+class TestAppInfo < MiniTest::Unit::TestCase
 
   def setup
     @conn = get_oci8_connection
@@ -14,7 +13,7 @@
     @conn.client_identifier = client_id
     assert_equal(client_id, @conn.select_one("SELECT SYS_CONTEXT('USERENV', 'CLIENT_IDENTIFIER') FROM DUAL")[0]);
     # check the first character
-    assert_raise ArgumentError do
+    assert_raises ArgumentError do
       @conn.client_identifier = ':bad_identifier'
     end
 

Modified: trunk/ruby-oci8/test/test_array_dml.rb
===================================================================
--- trunk/ruby-oci8/test/test_array_dml.rb	2013-06-23 09:40:55 UTC (rev 569)
+++ trunk/ruby-oci8/test/test_array_dml.rb	2013-07-15 05:39:30 UTC (rev 570)
@@ -1,8 +1,7 @@
 require 'oci8'
-require 'test/unit'
 require File.dirname(__FILE__) + '/config'
 
-class TestArrayDML < Test::Unit::TestCase
+class TestArrayDML < MiniTest::Unit::TestCase
   def setup
     @conn = get_oci8_connection
   end
@@ -131,7 +130,7 @@
       v_arr << i.to_s if i != max_array_size
     end
     cursor[1] = n_arr
-    assert_raise(RuntimeError) { cursor[2] = v_arr }
+    assert_raises(RuntimeError) { cursor[2] = v_arr }
     cursor.close
     
     drop_table('test_table')
@@ -154,9 +153,9 @@
     cursor.bind_param_array(1, [1, 2, 3])
     cursor.bind_param_array(2, ['happy', 'new', 'year'])
     cursor.bind_param_array(3, [Time.gm(1990,1,1), Time.gm(2000,1,1), Time.gm(2010,1,1)])
-    assert_nothing_raised() { cursor.exec_array }
+    cursor.exec_array
     cursor.max_array_size = 2
-    assert_raise(RuntimeError) { cursor.exec_array }
+    assert_raises(RuntimeError) { cursor.exec_array }
     drop_table('test_table')
   end
 
@@ -184,7 +183,7 @@
     end
     cursor[1] = n_arr
     cursor[2] = v_arr
-    assert_nothing_raised() { cursor.exec_array }
+    cursor.exec_array
     cursor.close
 
     cursor = @conn.parse("SELECT * FROM test_table ORDER BY N")
@@ -213,7 +212,7 @@
     cursor.max_array_size = max_array_size
     cursor.bind_param_array(1, nil, Fixnum)
     cursor.bind_param_array(2, nil, String)
-    assert_raise(RuntimeError) { cursor.exec_array }
+    assert_raises(RuntimeError) { cursor.exec_array }
     cursor.close
     drop_table('test_table')
   end

Modified: trunk/ruby-oci8/test/test_bind_raw.rb
===================================================================
--- trunk/ruby-oci8/test/test_bind_raw.rb	2013-06-23 09:40:55 UTC (rev 569)
+++ trunk/ruby-oci8/test/test_bind_raw.rb	2013-07-15 05:39:30 UTC (rev 570)
@@ -1,9 +1,8 @@
 # Low-level API
 require 'oci8'
-require 'test/unit'
 require File.dirname(__FILE__) + '/config'
 
-class TestBindRaw < Test::Unit::TestCase
+class TestBindRaw < MiniTest::Unit::TestCase
   CHECK_TARGET = [
     ["0123456789:;<=>?", "303132333435363738393A3B3C3D3E3F"],
     ["@ABCDEFGHIJKLMNO", "404142434445464748494A4B4C4D4E4F"],

Modified: trunk/ruby-oci8/test/test_bind_string.rb
===================================================================
--- trunk/ruby-oci8/test/test_bind_string.rb	2013-06-23 09:40:55 UTC (rev 569)
+++ trunk/ruby-oci8/test/test_bind_string.rb	2013-07-15 05:39:30 UTC (rev 570)
@@ -1,9 +1,8 @@
 # -*- coding: utf-8 -*-
 require 'oci8'
-require 'test/unit'
 require File.dirname(__FILE__) + '/config'
 
-class TestBindString < Test::Unit::TestCase
+class TestBindString < MiniTest::Unit::TestCase
   def setup
     @conn = get_oci8_connection
   end

Modified: trunk/ruby-oci8/test/test_bind_time.rb
===================================================================
--- trunk/ruby-oci8/test/test_bind_time.rb	2013-06-23 09:40:55 UTC (rev 569)
+++ trunk/ruby-oci8/test/test_bind_time.rb	2013-07-15 05:39:30 UTC (rev 570)
@@ -1,8 +1,7 @@
 require 'oci8'
-require 'test/unit'
 require File.dirname(__FILE__) + '/config'
 
-class TestBindTime < Test::Unit::TestCase
+class TestBindTime < MiniTest::Unit::TestCase
 
   YEAR_CHECK_TARGET = [1971, 1989, 2002, 2037]
   MON_CHECK_TARGET = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]

Modified: trunk/ruby-oci8/test/test_break.rb
===================================================================
--- trunk/ruby-oci8/test/test_break.rb	2013-06-23 09:40:55 UTC (rev 569)
+++ trunk/ruby-oci8/test/test_break.rb	2013-07-15 05:39:30 UTC (rev 570)
@@ -1,10 +1,9 @@
 # High-level API
 require 'oci8'
-require 'test/unit'
 require 'timeout'
 require File.dirname(__FILE__) + '/config'
 
-class TestBreak < Test::Unit::TestCase
+class TestBreak < MiniTest::Unit::TestCase
 
   def setup
     @conn = get_oci8_connection
@@ -107,7 +106,7 @@
       # MRI and Rubinius 2.0.0
       expected = Timeout::Error
     end
-    assert_raise(expected) do
+    assert_raises(expected) do
       Timeout.timeout(1) do
         @conn.exec("BEGIN DBMS_LOCK.SLEEP(5); END;")
       end

Modified: trunk/ruby-oci8/test/test_clob.rb
===================================================================
--- trunk/ruby-oci8/test/test_clob.rb	2013-06-23 09:40:55 UTC (rev 569)
+++ trunk/ruby-oci8/test/test_clob.rb	2013-07-15 05:39:30 UTC (rev 570)
@@ -1,9 +1,8 @@
 # Low-level API
 require 'oci8'
-require 'test/unit'
 require File.dirname(__FILE__) + '/config'
 
-class TestCLob < Test::Unit::TestCase
+class TestCLob < MiniTest::Unit::TestCase
 
   def setup
     @conn = get_oci8_connection

Modified: trunk/ruby-oci8/test/test_connection_pool.rb
===================================================================
--- trunk/ruby-oci8/test/test_connection_pool.rb	2013-06-23 09:40:55 UTC (rev 569)
+++ trunk/ruby-oci8/test/test_connection_pool.rb	2013-07-15 05:39:30 UTC (rev 570)
@@ -1,8 +1,7 @@
 require 'oci8'
-require 'test/unit'
 require File.dirname(__FILE__) + '/config'
 
-class TestConnectionPool < Test::Unit::TestCase
+class TestConnectionPool < MiniTest::Unit::TestCase
 
   def create_pool(min, max, incr)
     OCI8::ConnectionPool.new(min, max, incr, $dbuser, $dbpass, $dbname)
@@ -48,7 +47,7 @@
       if cnt == 0
         unless conn.non_blocking?
           non_blocking = false
-          assert_raise(RuntimeError) do
+          assert_raises(RuntimeError) do
             # This should raise "Could not set non-blocking mode to a connection allocated from OCI8::ConnectionPool."
             conn.non_blocking = true
           end

Modified: trunk/ruby-oci8/test/test_connstr.rb
===================================================================
--- trunk/ruby-oci8/test/test_connstr.rb	2013-06-23 09:40:55 UTC (rev 569)
+++ trunk/ruby-oci8/test/test_connstr.rb	2013-07-15 05:39:30 UTC (rev 570)
@@ -1,8 +1,7 @@
 require 'oci8'
-require 'test/unit'
 require File.dirname(__FILE__) + '/config'
 
-class TestConnStr < Test::Unit::TestCase
+class TestConnStr < MiniTest::Unit::TestCase
   TEST_CASES =
     [
      # success cases:
@@ -77,5 +76,3 @@
     end
   end
 end
-
-Test::Unit::AutoRunner.run() if $0 == __FILE__

Modified: trunk/ruby-oci8/test/test_datetime.rb
===================================================================
--- trunk/ruby-oci8/test/test_datetime.rb	2013-06-23 09:40:55 UTC (rev 569)
+++ trunk/ruby-oci8/test/test_datetime.rb	2013-07-15 05:39:30 UTC (rev 570)
@@ -1,9 +1,8 @@
 require 'oci8'
-require 'test/unit'
 require File.dirname(__FILE__) + '/config'
 require 'scanf'
 
-class TestDateTime < Test::Unit::TestCase
+class TestDateTime < MiniTest::Unit::TestCase
 
   def timezone_string(tzh, tzm)
     if tzh >= 0
@@ -247,7 +246,7 @@
   def test_timezone
     begin
       # temporarily change the mapping to test OCI8::BindType::Util.default_timezone.
-      assert_raise(ArgumentError) do
+      assert_raises(ArgumentError) do
         OCI8::BindType::Util.default_timezone = :invalid_value
       end
 

Modified: trunk/ruby-oci8/test/test_dbi.rb
===================================================================
--- trunk/ruby-oci8/test/test_dbi.rb	2013-06-23 09:40:55 UTC (rev 569)
+++ trunk/ruby-oci8/test/test_dbi.rb	2013-07-15 05:39:30 UTC (rev 570)
@@ -1,9 +1,8 @@
 require 'dbi'
 require 'oci8'
-require 'test/unit'
 require File.dirname(__FILE__) + '/config'
 
-class TestDBI < Test::Unit::TestCase
+class TestDBI < MiniTest::Unit::TestCase
 
   def setup
     @dbh = get_dbi_connection()

Modified: trunk/ruby-oci8/test/test_dbi_clob.rb
===================================================================
--- trunk/ruby-oci8/test/test_dbi_clob.rb	2013-06-23 09:40:55 UTC (rev 569)
+++ trunk/ruby-oci8/test/test_dbi_clob.rb	2013-07-15 05:39:30 UTC (rev 570)
@@ -1,23 +1,23 @@
 require 'dbi'
 require 'oci8'
-require 'test/unit'
 require File.dirname(__FILE__) + '/config'
 
-class TestDbiCLob < Test::Unit::TestCase
+class TestDbiCLob < MiniTest::Unit::TestCase
 
   def setup
     @dbh = get_dbi_connection()
+    drop_table('test_table')
+    @dbh.execute('CREATE TABLE test_table (filename VARCHAR2(40), content CLOB)')
   end
 
   def test_insert
     filename = File.basename($lobfile)
-    @dbh.do("DELETE FROM test_clob WHERE filename = :1", filename)
 
     # insert an empty clob and get the rowid.
-    rowid = @dbh.execute("INSERT INTO test_clob(filename, content) VALUES (:1, EMPTY_CLOB())", filename) do |sth|
+    rowid = @dbh.execute("INSERT INTO test_table(filename, content) VALUES (:1, EMPTY_CLOB())", filename) do |sth|
       sth.func(:rowid)
     end
-    lob = @dbh.select_one("SELECT content FROM test_clob WHERE filename = :1 FOR UPDATE", filename)[0]
+    lob = @dbh.select_one("SELECT content FROM test_table WHERE filename = :1 FOR UPDATE", filename)[0]
     begin
       open($lobfile) do |f|
         while f.gets()
@@ -32,7 +32,7 @@
   def test_read
     filename = File.basename($lobfile)
     test_insert() # first insert data.
-    lob = @dbh.select_one("SELECT content FROM test_clob WHERE filename = :1 FOR UPDATE", filename)[0]
+    lob = @dbh.select_one("SELECT content FROM test_table WHERE filename = :1 FOR UPDATE", filename)[0]
     begin
       open($lobfile) do |f|
         while buf = lob.read($lobreadnum)

Modified: trunk/ruby-oci8/test/test_encoding.rb
===================================================================
--- trunk/ruby-oci8/test/test_encoding.rb	2013-06-23 09:40:55 UTC (rev 569)
+++ trunk/ruby-oci8/test/test_encoding.rb	2013-07-15 05:39:30 UTC (rev 570)
@@ -1,8 +1,7 @@
 require 'oci8'
-require 'test/unit'
 require File.dirname(__FILE__) + '/config'
 
-class TestEncoding < Test::Unit::TestCase
+class TestEncoding < MiniTest::Unit::TestCase
   def setup
     @conn = get_oci8_connection
   end

Modified: trunk/ruby-oci8/test/test_error.rb
===================================================================
--- trunk/ruby-oci8/test/test_error.rb	2013-06-23 09:40:55 UTC (rev 569)
+++ trunk/ruby-oci8/test/test_error.rb	2013-07-15 05:39:30 UTC (rev 570)
@@ -1,8 +1,7 @@
 require 'oci8'
-require 'test/unit'
 require File.dirname(__FILE__) + '/config'
 
-class TestError < Test::Unit::TestCase
+class TestError < MiniTest::Unit::TestCase
   def setup
     @conn = get_oci8_connection
   end

Modified: trunk/ruby-oci8/test/test_metadata.rb
===================================================================
--- trunk/ruby-oci8/test/test_metadata.rb	2013-06-23 09:40:55 UTC (rev 569)
+++ trunk/ruby-oci8/test/test_metadata.rb	2013-07-15 05:39:30 UTC (rev 570)
@@ -1,8 +1,7 @@
 require 'oci8'
-require 'test/unit'
 require File.dirname(__FILE__) + '/config'
 
-class TestMetadata < Test::Unit::TestCase
+class TestMetadata < MiniTest::Unit::TestCase
 
   def setup
     @conn = get_oci8_connection
@@ -653,8 +652,8 @@
       assert_equal(false, desc.is_temporary?)
       assert_equal(false, desc.is_typed?)
       assert_nil(desc.duration)
-      assert_not_nil(desc.dba)
-      assert_not_nil(desc.tablespace)
+      refute_nil(desc.dba)
+      refute_nil(desc.tablespace)
       assert_equal(false, desc.clustered?)
       assert_equal(false, desc.partitioned?)
       assert_equal(false, desc.index_only?)
@@ -682,8 +681,8 @@
       assert_equal(true, desc.is_temporary?)
       assert_equal(false, desc.is_typed?)
       assert_equal(:transaction, desc.duration)
-      assert_not_nil(desc.dba)
-      assert_not_nil(desc.tablespace)
+      refute_nil(desc.dba)
+      refute_nil(desc.tablespace)
       assert_equal(false, desc.clustered?)
       assert_equal(false, desc.partitioned?)
       assert_equal(false, desc.index_only?)
@@ -712,8 +711,8 @@
       assert_equal(true, desc.is_temporary?)
       assert_equal(false, desc.is_typed?)
       assert_equal(:session, desc.duration)
-      assert_not_nil(desc.dba)
-      assert_not_nil(desc.tablespace)
+      refute_nil(desc.dba)
+      refute_nil(desc.tablespace)
       assert_equal(false, desc.clustered?)
       assert_equal(false, desc.partitioned?)
       assert_equal(false, desc.index_only?)
@@ -744,8 +743,8 @@
       assert_equal(false, desc.is_temporary?)
       assert_equal(true, desc.is_typed?)
       assert_equal(nil, desc.duration)
-      assert_not_nil(desc.dba)
-      assert_not_nil(desc.tablespace)
+      refute_nil(desc.dba)
+      refute_nil(desc.tablespace)
       assert_equal(false, desc.clustered?)
       assert_equal(false, desc.partitioned?)
       assert_equal(false, desc.index_only?)
@@ -775,8 +774,8 @@
       assert_equal(false, desc.is_temporary?)
       assert_equal(false, desc.is_typed?)
       assert_equal(nil, desc.duration)
-      assert_not_nil(desc.dba)
-      assert_not_nil(desc.tablespace)
+      refute_nil(desc.dba)
+      refute_nil(desc.tablespace)
       assert_equal(false, desc.clustered?)
       assert_equal(false, desc.partitioned?)
       assert_equal(true, desc.index_only?)

Modified: trunk/ruby-oci8/test/test_object.rb
===================================================================
--- trunk/ruby-oci8/test/test_object.rb	2013-06-23 09:40:55 UTC (rev 569)
+++ trunk/ruby-oci8/test/test_object.rb	2013-07-15 05:39:30 UTC (rev 570)
@@ -1,5 +1,4 @@
 require 'oci8'
-require 'test/unit'
 require File.dirname(__FILE__) + '/config'
 
 conn = OCI8.new($dbuser, $dbpass, $dbname)
@@ -49,7 +48,7 @@
 class RbTestIntArray < OCI8::Object::Base
 end
 
-class TestObj1 < Test::Unit::TestCase
+class TestObj1 < MiniTest::Unit::TestCase
   Delta = 0.00001
 
   def setup
@@ -71,7 +70,7 @@
   end
 
   class ExpectedVal
-    include Test::Unit::Assertions
+    include MiniTest::Assertions
 
     attr_reader :n
     attr_reader :int_val
@@ -97,8 +96,11 @@
     attr_reader :date_val
 #    attr_reader :date_array_val
 
+    attr_accessor :assertions
+
     def initialize
       @n = 0.0
+      @assertions = 0
     end
 
     def to_test_date(n)
@@ -303,9 +305,7 @@
     while expected_val.next
       obj = RbTestObj.new(expected_val.n)
       expected_val.should_be_equal(obj)
-      assert_nothing_raised do
-        obj.inspect
-      end
+      obj.inspect
     end
   end
 
@@ -318,10 +318,7 @@
   end
 
   def _test_implicit_constructor2 # TODO
-    obj = nil
-    assert_nothing_raised do
-      obj = RbTestObj.new(nil, nil, nil)
-    end
+    obj = RbTestObj.new(nil, nil, nil)
     assert_nil(obj.int_val)
     assert_nil(obj.flt_val)
     assert_nil(obj.str_val)

Modified: trunk/ruby-oci8/test/test_oci8.rb
===================================================================
--- trunk/ruby-oci8/test/test_oci8.rb	2013-06-23 09:40:55 UTC (rev 569)
+++ trunk/ruby-oci8/test/test_oci8.rb	2013-07-15 05:39:30 UTC (rev 570)
@@ -1,10 +1,9 @@
 require 'oci8'
-require 'test/unit'
 require File.dirname(__FILE__) + '/config'
 require 'bigdecimal'
 require 'rational'
 
-class TestOCI8 < Test::Unit::TestCase
+class TestOCI8 < MiniTest::Unit::TestCase
 
   def setup
     @conn = get_oci8_connection

Modified: trunk/ruby-oci8/test/test_oracle_version.rb
===================================================================
--- trunk/ruby-oci8/test/test_oracle_version.rb	2013-06-23 09:40:55 UTC (rev 569)
+++ trunk/ruby-oci8/test/test_oracle_version.rb	2013-07-15 05:39:30 UTC (rev 570)
@@ -1,8 +1,7 @@
 require 'oci8'
-require 'test/unit'
 require File.dirname(__FILE__) + '/config'
 
-class TestOracleVersion < Test::Unit::TestCase
+class TestOracleVersion < MiniTest::Unit::TestCase
 
   def test_init
     oraver = OCI8::OracleVersion.new('8.1.6.2.3')
@@ -67,4 +66,3 @@
   end
 end
 
-Test::Unit::AutoRunner.run() if $0 == __FILE__

Modified: trunk/ruby-oci8/test/test_oradate.rb
===================================================================
--- trunk/ruby-oci8/test/test_oradate.rb	2013-06-23 09:40:55 UTC (rev 569)
+++ trunk/ruby-oci8/test/test_oradate.rb	2013-07-15 05:39:30 UTC (rev 570)
@@ -1,9 +1,8 @@
 # Low-level API
 require 'oci8'
-require 'test/unit'
 require File.dirname(__FILE__) + '/config'
 
-class TestOraDate < Test::Unit::TestCase
+class TestOraDate < MiniTest::Unit::TestCase
 
   YEAR_CHECK_TARGET = [-4712, -1, 1, 1192, 1868, 2002, 9999]
   MONTH_CHECK_TARGET = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]

Modified: trunk/ruby-oci8/test/test_oranumber.rb
===================================================================
--- trunk/ruby-oci8/test/test_oranumber.rb	2013-06-23 09:40:55 UTC (rev 569)
+++ trunk/ruby-oci8/test/test_oranumber.rb	2013-07-15 05:39:30 UTC (rev 570)
@@ -1,12 +1,11 @@
 # Low-level API
 require 'oci8'
-require 'test/unit'
 require File.dirname(__FILE__) + '/config'
 require 'yaml'
 require 'bigdecimal'
 require 'rational'
 
-class TestOraNumber < Test::Unit::TestCase
+class TestOraNumber < MiniTest::Unit::TestCase
 
   LARGE_RANGE_VALUES = [
     "12345678901234567890123456789012345678",
@@ -476,7 +475,7 @@
                           Proc.new {|x, y| x.round_prec(y)})
     else
       # Oracle 8.0 client
-      assert_raise NoMethodError do
+      assert_raises NoMethodError do
         OraNumber.new(1).round_prec(1)
       end
     end
@@ -491,7 +490,7 @@
                           Proc.new {|x, y| x.shift(y)})
     else
       # Oracle 8.0 client
-      assert_raise NoMethodError do
+      assert_raises NoMethodError do
         OraNumber.new(1).shift(1)
       end
     end
@@ -702,7 +701,7 @@
 
   def test_new_from_bigdecimal
     ["+Infinity", "-Infinity", "NaN"].each do |n|
-      assert_raise TypeError do
+      assert_raises TypeError do
         OraNumber.new(BigDecimal.new(n))
       end
     end

Modified: trunk/ruby-oci8/test/test_rowid.rb
===================================================================
--- trunk/ruby-oci8/test/test_rowid.rb	2013-06-23 09:40:55 UTC (rev 569)
+++ trunk/ruby-oci8/test/test_rowid.rb	2013-07-15 05:39:30 UTC (rev 570)
@@ -1,8 +1,7 @@
 require 'oci8'
-require 'test/unit'
 require File.dirname(__FILE__) + '/config'
 
-class TestRowid < Test::Unit::TestCase
+class TestRowid < MiniTest::Unit::TestCase
 
   def setup
     @conn = get_oci8_connection



More information about the ruby-oci8-commit mailing list