test/SQLTest.rb in rubyfb-0.6 vs test/SQLTest.rb in rubyfb-0.6.1

- old
+ new

@@ -88,15 +88,15 @@ r.close r = @transactions[0].execute("SELECT * FROM TEST_TABLE WHERE TESTID IN "\ "(2, 4, 6, 8, 10) ORDER BY TESTID ASCENDING") a = r.fetch - assert(a[0] == 2) - assert(a[1] == '3.0') - assert(a[2] == 3.0) - assert(a[3] == nil) - assert(a[4] == nil) + assert_equal(2, a[0]) + assert_equal('3.0', a[1]) + assert_equal(3.0, a[2]) + assert_nil(a[3]) + assert_nil(a[4]) a = r.fetch assert(a[0] == 4) assert(a[1] == '10.0') assert(a[2] == 10.0) @@ -153,17 +153,18 @@ t = Time.new s.exec([25000, 'La la la', 3.14, t], tx) s.close # Fetch the record and check the data. - r = tx.execute("SELECT TESTTEXT, TESTFLOAT, TESTSTAMP FROM "\ + r = tx.execute("SELECT TESTTEXT, TESTFLOAT, TESTSTAMP, cast(TESTFLOAT as varchar(20)) as TESTFLOAT_TXT FROM "\ "TEST_TABLE WHERE TESTID = 25000") a = r.fetch r.close end - assert(a[0] == 'La la la') - assert(a[1] == 3.14) - assert(a[2].to_i == t.to_i) + assert_equal('3.14', a[3]) + assert_equal('La la la', a[0]) + assert_equal(3.14, a[1]) + assert_equal(t.to_i, a[2].to_i) @connections[0].execute_immediate("DELETE FROM TEST_TABLE WHERE TESTID "\ "IN (1, 3, 5, 7, 9, 12, 14, 16, 18, 20)") @database.connect(DB_USER_NAME, DB_PASSWORD) do |cxn| a = []