Sha256: da58ecb2f3ca13308817fb3229e4950b364de2e3bda7aba9585e7ad6b4d28bda

Contents?: true

Size: 1001 Bytes

Versions: 4

Compression:

Stored size: 1001 Bytes

Contents

# $Id: test_yaml_configurator.rb 38 2007-10-26 20:05:51Z tim_pease $

require 'stringio'
require 'yaml'
require 'test/setup.rb'

module TestLogging
module TestConfig

  class TestYamlConfigurator < Test::Unit::TestCase
    include LoggingTestCase

    def setup
      super
    end

    def test_class_load
      assert_raise(::Logging::Config::YamlConfigurator::Error) {
        ::Logging::Config::YamlConfigurator.load(Object.new)
      }

      begin
        fd = File.open('data/logging.yaml','r')
        assert_nothing_raised {
          ::Logging::Config::YamlConfigurator.load(fd)
        }
      ensure
        fd.close
      end
    end

    def test_initialize
      io = StringIO.new
      io << YAML.dump({:one => 1, :two => 2, :three => 3})
      io.seek 0

      assert_raise(::Logging::Config::YamlConfigurator::Error) {
        ::Logging::Config::YamlConfigurator.new(io)
      }
    end

  end  # class TestYamlConfigurator

end  # module TestConfig
end  # module TestLogging

# EOF

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
logging-0.5.1 test/config/test_yaml_configurator.rb
logging-0.5.0 test/config/test_yaml_configurator.rb
logging-0.5.2 test/config/test_yaml_configurator.rb
logging-0.5.3 test/config/test_yaml_configurator.rb