Sha256: dc99a17d3ae2b536d3465dff27a88250c0957e911ae73a844fa55510c349e751

Contents?: true

Size: 1.39 KB

Versions: 3

Compression:

Stored size: 1.39 KB

Contents

require 'test/unit'
require 'yaml'
require File.expand_path '../../../../lib/config/app_config_params.rb', __FILE__

class TestAppConfigParams < Test::Unit::TestCase

  include Theotokos::Configuration
  
  def test_load_params
    ENV['app.cfg.path'] = 'test/app-cfg.yml'
    AppConfigParams.load_app_config_params
    
    assert_equal ENV['ws.config.path'], 'test/config/ws-config.yml'
    assert_equal ENV['logger.stdout.level'], 'info'
    assert_equal ENV['logger.stdout.layout.pattern'], '[%d] %-5l -- %c : %m\n'
    assert_equal ENV['logger.stdout.layout.date_pattern'], '%Y-%m-%d %H:%M:%S'
    assert_equal ENV['logger.rolling_file.level'], 'debug'
    assert_equal ENV['logger.rolling_file.file'], 'test/log/app-test.log'
    assert_equal ENV['logger.rolling_file.pattern'], '[%d] %-5l -- %c : %m\n'
    assert_equal ENV['logger.rolling_file.date_pattern'], '%Y-%m-%d %H:%M:%S'
  end
  
  def test_load_default_params
    ENV['app.cfg.path'] = nil
    AppConfigParams.load_app_config_params
    
    assert_equal ENV['ws.config.path'], 'resources/config/ws-config.yml'
    assert_equal ENV['ws.test.models.path'], 'resources/ws-test-models'
    assert_equal ENV['ws.test.output.files.path'], 'resources/outputs'
    assert_equal ENV['ws.test.reports.locales.path'], 'resources/locales'
    assert_equal ENV['ws.test.reports.locale'], 'en'
    assert_equal ENV['ws.test.reports.path'], 'tmp/reports'
  end
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
theotokos-0.1.3 test/unit/config/test_app_config_params.rb
theotokos-0.1.2 test/unit/config/test_app_config_params.rb
theotokos-0.1.1 test/unit/config/test_app_config_params.rb