[ruby-oci8-commit] [543] trunk/ruby-oci8: fix to pass tests with ruby 2.0.0 preview2.

nobody at rubyforge.org nobody at rubyforge.org
Sun Dec 2 10:17:05 UTC 2012


Revision: 543
Author:   kubo
Date:     2012-12-02 10:17:05 +0000 (Sun, 02 Dec 2012)
Log Message:
-----------
fix to pass tests with ruby 2.0.0 preview2.

Modified Paths:
--------------
    trunk/ruby-oci8/ChangeLog
    trunk/ruby-oci8/test/test_encoding.rb

Modified: trunk/ruby-oci8/ChangeLog
===================================================================
--- trunk/ruby-oci8/ChangeLog	2012-11-11 13:05:57 UTC (rev 542)
+++ trunk/ruby-oci8/ChangeLog	2012-12-02 10:17:05 UTC (rev 543)
@@ -1,3 +1,6 @@
+2012-12-02  KUBO Takehiro  <kubo at jiubao.org>
+	* test/test_encoding.rb: fix to pass tests with ruby 2.0.0 preview2.
+
 2012-11-11  KUBO Takehiro  <kubo at jiubao.org>
 	* ext/oci8/lob.c: use OCILobLocatorAssign_nb (non-blocking version)
 	    instead of OCILobLocatorAssign (blocking version).

Modified: trunk/ruby-oci8/test/test_encoding.rb
===================================================================
--- trunk/ruby-oci8/test/test_encoding.rb	2012-11-11 13:05:57 UTC (rev 542)
+++ trunk/ruby-oci8/test/test_encoding.rb	2012-12-02 10:17:05 UTC (rev 543)
@@ -25,7 +25,7 @@
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0)
 EOS
-    ascii_8bit = Encoding.find('ASCII-8BIT')
+    ascii_8bit = "\xab\xcd".force_encoding('ASCII-8BIT')
     @conn.exec(<<EOS)
 INSERT INTO test_table VALUES ('abcd', 'abcd', 'abcd', 'abcd', 'abcd', 'abcd', 'abcd')
 EOS
@@ -34,16 +34,16 @@
       assert_equal(OCI8.encoding, row[0].encoding);
       assert_equal('abcd', row[1], 'VARCHAR2(10)')
       assert_equal(OCI8.encoding, row[1].encoding);
-      assert_equal("\xab\xcd", row[2], 'RAW(10)')
-      assert_equal(ascii_8bit, row[2].encoding);
-      assert_equal("\xab\xcd", row[3], 'LONG RAW')
-      assert_equal(ascii_8bit, row[3].encoding);
+      assert_equal(ascii_8bit, row[2], 'RAW(10)')
+      assert_equal(ascii_8bit.encoding, row[2].encoding);
+      assert_equal(ascii_8bit, row[3], 'LONG RAW')
+      assert_equal(ascii_8bit.encoding, row[3].encoding);
       assert_equal('abcd', (data = row[4].read), 'CLOB')
       assert_equal(OCI8.encoding, data.encoding);
       assert_equal('abcd', (data = row[5].read), 'NCLOB')
       assert_equal(OCI8.encoding, data.encoding);
-      assert_equal("\xab\xcd", (data = row[6].read), 'BLOB')
-      assert_equal(ascii_8bit, data.encoding);
+      assert_equal(ascii_8bit, (data = row[6].read), 'BLOB')
+      assert_equal(ascii_8bit.encoding, data.encoding);
 
       if OCI8.encoding.name == "UTF-8" and ['WE8ISO8859P1', 'WE8ISO8859P15', 'AL32UTF8', 'UTF8'].include? @conn.database_charset_name
         utf_8 = "\u00A1\u00A2\u00A3\u00A5\u00A7\u00A9"



More information about the ruby-oci8-commit mailing list