test/RowCountTest.rb in rubyfb-0.5.9 vs test/RowCountTest.rb in rubyfb-0.6
- old
+ new
@@ -33,32 +33,32 @@
end
def test01
@database.connect(DB_USER_NAME, DB_PASSWORD) do |cxn|
cxn.start_transaction do |tx|
- assert(cxn.execute_immediate('insert into test values (1000)') == 1)
- assert(cxn.execute_immediate('insert into test values (1000)') == 1)
- assert(cxn.execute('insert into test values (2000)', tx) == 1)
- assert(cxn.execute('insert into test values (2000)', tx) == 1)
- assert(tx.execute('insert into test values (3000)') == 1)
- assert(tx.execute('insert into test values (3000)') == 1)
- assert(tx.execute('insert into test values (4000)') == 1)
- assert(tx.execute('insert into test values (4000)') == 1)
+ assert_equal(1, cxn.execute_immediate('insert into test values (1000)'))
+ assert_equal(1, cxn.execute_immediate('insert into test values (1000)'))
+ assert_equal(1, cxn.execute('insert into test values (2000)', tx))
+ assert_equal(1, cxn.execute('insert into test values (2000)', tx))
+ assert_equal(1, tx.execute('insert into test values (3000)'))
+ assert_equal(1, tx.execute('insert into test values (3000)'))
+ assert_equal(1, tx.execute('insert into test values (4000)'))
+ assert_equal(1, tx.execute('insert into test values (4000)'))
- assert(cxn.execute_immediate('update test set id = 10000 where '\
- 'id = 1000') == 2)
- assert(cxn.execute('update test set id = 20000 where id = 2000',
- tx) == 2)
- assert(tx.execute('update test set id = 30000 where id = 3000') == 2)
+ assert_equal(2, cxn.execute_immediate('update test set id = 10000 where '\
+ 'id = 1000'))
+ assert_equal(2, cxn.execute('update test set id = 20000 where id = 2000',
+ tx))
+ assert_equal(2, tx.execute('update test set id = 30000 where id = 3000'))
- s = Statement.new(cxn, tx, 'update test set id = 40000 where id = ?',
- 3)
- assert(s.execute_for([4000]) == 2)
+ s = cxn.create_statement('update test set id = 40000 where id = ?')
+
+ assert_equal(2, s.exec([4000], tx))
- assert(cxn.execute_immediate('delete from test where id = 10000') == 2)
- assert(cxn.execute('delete from test where id = 20000', tx) == 2)
- assert(tx.execute('delete from test where id = 30000') == 2)
+ assert_equal(2, cxn.execute_immediate('delete from test where id = 10000'))
+ assert_equal(2, cxn.execute('delete from test where id = 20000', tx))
+ assert_equal(2, tx.execute('delete from test where id = 30000'))
end
end
end
end