test/unit/config_tests.rb in ardb-0.20.0 vs test/unit/config_tests.rb in ardb-0.21.0
- old
+ new
@@ -1,13 +1,15 @@
require 'assert'
-require 'ns-options/assert_macros'
require 'ardb'
+require 'ns-options/assert_macros'
+
class Ardb::Config
- class BaseTests < Assert::Context
+ class UnitTests < Assert::Context
include NsOptions::AssertMacros
+
desc "Ardb::Config"
subject{ Ardb::Config }
should have_namespace :db
should have_option :db_file, Pathname, :default => ENV['ARDB_DB_FILE']
@@ -19,12 +21,12 @@
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
+ should "should use `db/schema` as the default schema path" do
+ exp_path = Pathname.new(TESTDB_PATH).join("db/schema").to_s
assert_equal exp_path, subject.schema_path
end
should "build the db connection settings from the db configs" do
# returns only non-nil values with string keys
@@ -35,10 +37,10 @@
assert_equal exp, subject.db_settings
end
end
- class DbTests < BaseTests
+ class DbTests < UnitTests
desc "db namespace"
subject{ Ardb::Config.db }
should have_option :adapter, String, :required => true
should have_option :database, String, :required => true