File: test_ping.rb

package info (click to toggle)
ruby-dbd-pg 0.3.9%2Bgem2deb-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 348 kB
  • ctags: 231
  • sloc: ruby: 2,214; sql: 91; makefile: 2
file content (10 lines) | stat: -rw-r--r-- 357 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
class TestPostgresPing < DBDConfig.testbase(:postgresql)
    def test_ping
        config = DBDConfig.get_config['postgresql']
        dbh = DBI.connect("dbi:Pg:#{config['dbname']}", config['username'], config['password'])
        assert dbh
        assert dbh.ping
        dbh.disconnect
        assert_raises(DBI::InterfaceError) { dbh.ping }
    end
end