Sha256: cb3960e238f0c6a63cf6cf4e6250b353452298eb35416a43c39b0f7c61142563
Contents?: true
Size: 906 Bytes
Versions: 17
Compression:
Stored size: 906 Bytes
Contents
require 'fileutils' DBDConfig.set_testbase(:postgresql, Class.new(Test::Unit::TestCase) do def dbtype "postgresql" end def test_base assert_equal(@dbh.driver_name, "Pg") assert_kind_of(DBI::DBD::Pg::Database, @dbh.instance_variable_get(:@handle)) end def set_base_dbh config = DBDConfig.get_config['postgresql'] @dbh = DBI.connect("dbi:Pg:#{config['dbname']}", config['username'], config['password']) end def setup set_base_dbh DBDConfig.inject_sql(@dbh, dbtype, "dbd/postgresql/up.sql") end def teardown @sth.finish if @sth && !@sth.finished? config = DBDConfig.get_config['postgresql'] DBDConfig.inject_sql(@dbh, dbtype, "dbd/postgresql/down.sql") @dbh.disconnect end end )
Version data entries
17 entries across 17 versions & 3 rubygems