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

Version Path
ydbd-pg-0.6.0 test/dbd/postgresql/base.rb
ydbi-0.6.0 test/dbd/postgresql/base.rb
ydbd-pg-0.5.9 test/dbd/postgresql/base.rb
ydbd-pg-0.5.8 test/dbd/postgresql/base.rb
ydbd-pg-0.5.7 test/dbd/postgresql/base.rb
ydbi-0.5.7 test/dbd/postgresql/base.rb
ydbd-pg-0.5.6 test/dbd/postgresql/base.rb
ydbd-pg-0.5.5 test/dbd/postgresql/base.rb
ydbd-pg-0.5.4 test/dbd/postgresql/base.rb
ydbd-pg-0.5.3 test/dbd/postgresql/base.rb
ydbd-pg-0.5.2 test/dbd/postgresql/base.rb
ydbd-pg-0.5.1 test/dbd/postgresql/base.rb
ydbi-0.5.0 test/dbd/postgresql/base.rb
dbd-pg-0.3.9 test/dbd/postgresql/base.rb
dbd-pg-0.3.8 test/dbd/postgresql/base.rb
dbd-pg-0.3.6 test/dbd/postgresql/base.rb
dbd-pg-0.3.7 test/dbd/postgresql/base.rb