Sha256: 95c0dbf051b76b0a5ba5f80628d982d806f4b29f27a4419b1a82951ba9b49cc5

Contents?: true

Size: 1.25 KB

Versions: 3

Compression:

Stored size: 1.25 KB

Contents

require 'assert'
require 'ns-options/assert_macros'
require 'ardb'

class Ardb::Config

  class BaseTests < Assert::Context
    include NsOptions::AssertMacros
    desc "Ardb::Config"
    subject{ Ardb::Config }

    should have_namespace :db
    should have_option  :root_path, Pathname, :required => true
    should have_option  :logger, :required => true
    should have_options :migrations_path, :schema_path

    should "should use `db/migrations` as the default migrations path" do
      exp_path = Pathname.new(TESTDB_PATH).join("db/migrations").to_s
      assert_equal exp_path, subject.migrations_path
    end

    should "should use `db/schema.rb` as the default schema path" do
      exp_path = Pathname.new(TESTDB_PATH).join("db/schema.rb").to_s
      assert_equal exp_path, subject.schema_path
    end

  end

  class DbTests < BaseTests
    desc "db namespace"
    subject{ Ardb::Config.db }

    should have_option :adapter,  String, :required => true
    should have_option :database, String, :required => true
    should have_option :encoding, String, :required => false
    should have_option :url,      String, :required => false
    should have_option :username, String, :required => false
    should have_option :password, String, :required => false

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ardb-0.3.0 test/unit/config_tests.rb
ardb-0.2.0 test/unit/config_tests.rb
ardb-0.1.0 test/unit/config_tests.rb