[ruby-oci8-commit] [526] trunk/ruby-oci8: speed up clob tests 29 times.

nobody at rubyforge.org nobody at rubyforge.org
Fri May 25 12:13:15 UTC 2012


Revision: 526
Author:   kubo
Date:     2012-05-25 12:13:15 +0000 (Fri, 25 May 2012)
Log Message:
-----------
speed up clob tests 29 times.

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

Modified: trunk/ruby-oci8/ChangeLog
===================================================================
--- trunk/ruby-oci8/ChangeLog	2012-05-25 12:08:40 UTC (rev 525)
+++ trunk/ruby-oci8/ChangeLog	2012-05-25 12:13:15 UTC (rev 526)
@@ -1,4 +1,7 @@
 2012-05-25  KUBO Takehiro  <kubo at jiubao.org>
+	* test/test_clob.rb: speed up clob tests 29 times.
+
+2012-05-25  KUBO Takehiro  <kubo at jiubao.org>
 	* test/setup_test_object.sql, test/test_all.rb, test/test_object.rb:
 	   Add tests of the previous commit.
 

Modified: trunk/ruby-oci8/test/test_clob.rb
===================================================================
--- trunk/ruby-oci8/test/test_clob.rb	2012-05-25 12:08:40 UTC (rev 525)
+++ trunk/ruby-oci8/test/test_clob.rb	2012-05-25 12:13:15 UTC (rev 526)
@@ -18,8 +18,8 @@
     cursor = @conn.exec("SELECT content FROM test_table WHERE filename = :1 FOR UPDATE", filename)
     lob = cursor.fetch[0]
     open($lobfile) do |f|
-      while f.gets()
-        lob.write($_)
+      while s = f.read(1000)
+        lob.write(s)
       end
     end
     lob.close
@@ -33,8 +33,8 @@
     lob = cursor.fetch[0]
     lob.sync = false
     open($lobfile) do |f|
-      while f.gets()
-        lob.write($_)
+      while s = f.read(1000)
+        lob.write(s)
       end
     end
     lob.flush



More information about the ruby-oci8-commit mailing list