File: test_statement.rb

package info (click to toggle)
ruby-dbd-odbc 0.2.5%2Bgem2deb-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 276 kB
  • ctags: 118
  • sloc: ruby: 1,083; sql: 52; makefile: 2
file content (44 lines) | stat: -rw-r--r-- 1,389 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
class TestODBCStatement < DBDConfig.testbase(:odbc)
    def test_column_info
        sth = nil
        
        assert_nothing_raised do 
            sth = @dbh.prepare("select * from names")
            sth.execute
        end

        assert_kind_of Array, sth.column_info 
        assert_kind_of DBI::ColumnInfo, sth.column_info[0]
        assert_kind_of DBI::ColumnInfo, sth.column_info[1]
        # XXX odbc seems to have a problem with this every other edition of unixodbc or so.
        #     yes, I know this test is important.
#         assert_equal [
#             {
#                 :table=>"names", 
#                 :precision=>255, 
#                 :searchable=>true, 
#                 :name=>"name", 
#                 :unsigned=>true, 
#                 :length=>255, 
#                 :sql_type=>12, 
#                 :scale=>0, 
#                 :nullable=>true, 
#                 :type_name=>"VARCHAR"
#             },
#             {
#                 :table=>"names", 
#                 :precision=>10, 
#                 :searchable=>true, 
#                 :name=>"age", 
#                 :unsigned=>false, 
#                 :length=>4, 
#                 :sql_type=>4, 
#                 :scale=>0, 
#                 :nullable=>true, 
#                 :type_name=>"INTEGER"
#             }
#         ], sth.column_info

        sth.finish
    end
end