test/BlobTest.rb in rubyfb-0.5.9 vs test/BlobTest.rb in rubyfb-0.6
- old
+ new
@@ -37,12 +37,12 @@
d = nil
@database.connect(DB_USER_NAME, DB_PASSWORD) do |cxn|
cxn.execute_immediate('create table blob_test (data blob sub_type 0)')
cxn.start_transaction do |tx|
- s = Statement.new(cxn, tx, 'INSERT INTO BLOB_TEST VALUES(?)', 3)
- s.execute_for([DATA])
+ s = cxn.create_statement('INSERT INTO BLOB_TEST VALUES(?)')
+ s.exec([DATA], tx)
# Perform a select of the value inserted.
r = cxn.execute('SELECT * FROM BLOB_TEST', tx)
d = r.fetch
@@ -60,17 +60,17 @@
d = nil
@database.connect(DB_USER_NAME, DB_PASSWORD) do |cxn|
cxn.execute_immediate('create table blob_test (data blob sub_type 1 segment size 10 CHARACTER SET UTF8)')
cxn.start_transaction do |tx|
- s = Statement.new(cxn, tx, 'INSERT INTO BLOB_TEST VALUES(?)', 3)
- s.execute_for([UTF_DATA])
+ s = cxn.create_statement('INSERT INTO BLOB_TEST VALUES(?)')
+ s.exec([UTF_DATA], tx)
# Perform a select of the value inserted.
r = cxn.execute('SELECT * FROM BLOB_TEST', tx)
d = r.fetch
- assert_equal(d[0].to_s, UTF_DATA)
+ assert_equal(UTF_DATA, d[0].to_s)
# Clean up.
s.close
r.close
end