Sha256: b31777f7871253da10267bdd3a4a6bd393683c2443463a35e4c0a122771b9da1

Contents?: true

Size: 1.09 KB

Versions: 17

Compression:

Stored size: 1.09 KB

Contents

require 'assert'
require 'ardb/adapter/postgresql'

class Ardb::Adapter::Postgresql

  class BaseTests < Assert::Context
    desc "Ardb::Adapter::Postgresql"
    setup do
      @adapter = Ardb::Adapter::Postgresql.new
    end
    subject { @adapter }

    should have_instance_method :public_schema_settings

    should "know it's public schema connection settings" do
      exp_settings = subject.config_settings.merge({
        'database' => 'postgres',
        'schema_search_path' => 'public'
      })
      assert_equal exp_settings, subject.public_schema_settings
    end

    should "know its foreign key add sql" do
      exp_add_sql = "ALTER TABLE :from_table"\
                    " ADD CONSTRAINT :name"\
                    " FOREIGN KEY (:from_column)"\
                    " REFERENCES :to_table (:to_column)"
      assert_equal exp_add_sql, subject.foreign_key_add_sql
    end

    should "know its foreign key drop sql" do
      exp_drop_sql = "ALTER TABLE :from_table"\
                     " DROP CONSTRAINT :name"
      assert_equal exp_drop_sql, subject.foreign_key_drop_sql
    end

  end

end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
ardb-0.20.0 test/unit/adapter/postgresql_tests.rb
ardb-0.19.0 test/unit/adapter/postgresql_tests.rb
ardb-0.18.0 test/unit/adapter/postgresql_tests.rb
ardb-0.17.0 test/unit/adapter/postgresql_tests.rb
ardb-0.16.0 test/unit/adapter/postgresql_tests.rb
ardb-0.15.0 test/unit/adapter/postgresql_tests.rb
ardb-0.14.0 test/unit/adapter/postgresql_tests.rb
ardb-0.13.0 test/unit/adapter/postgresql_tests.rb
ardb-0.12.0 test/unit/adapter/postgresql_tests.rb
ardb-0.11.0 test/unit/adapter/postgresql_tests.rb
ardb-0.10.0 test/unit/adapter/postgresql_tests.rb
ardb-0.9.0 test/unit/adapter/postgresql_tests.rb
ardb-0.8.0 test/unit/adapter/postgresql_tests.rb
ardb-0.7.0 test/unit/adapter/postgresql_tests.rb
ardb-0.6.0 test/unit/adapter/postgresql_tests.rb
ardb-0.5.0 test/unit/adapter/postgresql_tests.rb
ardb-0.4.1 test/unit/adapter/postgresql_tests.rb