Sha256: 0b0cdba91a7c2a51af363d961a23ebdabe8aba150f8df442816b43177a1733c5

Contents?: true

Size: 1.05 KB

Versions: 5

Compression:

Stored size: 1.05 KB

Contents

#!/usr/bin/env ruby

class TestConfiguration < TestImpl
  def setup
    usage_string = 'Test Banner'
    options_map = {
      environment: {
        val:   'test',
        type:  String,
        doc:   'Configure the environment for this session',
        short: '-e',
        arg:   'ENV',
      }
    }
    @config = WAB::Impl::Configuration.new(usage_string, options_map)
  end

  def test_initialization
    assert_equal({environment:'test', mode:'run'}, @config.map )
  end

  def test_parse_config_file
    expected = {
      :store   => { :dir => "$BASE/test/store/data" },
      :handler => [{ :type =>"Article" }],
      :http    => { :dir => "$BASE/view/test-pages" }
    }
    assert_equal(expected,
      @config.parse_config_file(File.expand_path('samples/test-config.conf', __dir__))
    )
    assert_equal(expected,
      @config.parse_config_file(File.expand_path('samples/test-config.json', __dir__))
    )
    assert_raises(LoadError) {
      @config.parse_config_file(File.expand_path('samples/test-config.yml', __dir__))
    }
  end
end # TestConfiguration

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
wabur-0.7.0 test/test_configuration.rb
wabur-0.6.2 test/test_configuration.rb
wabur-0.6.1 test/test_configuration.rb
wabur-0.6.0 test/test_configuration.rb
wabur-0.5.0 test/test_configuration.rb