Sha256: cd2ff932ed3df806619f28949c818bbf08427e392173fab42d414d2b48a07210

Contents?: true

Size: 1.14 KB

Versions: 10

Compression:

Stored size: 1.14 KB

Contents

require File.expand_path('setup', File.dirname(__FILE__))

module TestLogging

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

    def test_root
      Logging.consolidate :root
      root = Logging.logger.root

      assert_same root, Logging.logger['Foo']
      assert_same root, Logging.logger['Foo::Bar']
      assert_same root, Logging.logger[Array]
    end

    def test_foo
      Logging.consolidate 'Foo'
      logger = Logging.logger['Foo::Bar::Baz']

      assert_same Logging.logger['Foo'], logger
      assert_not_same Logging.logger.root, logger
    end

    def test_many
      Logging.consolidate 'Foo', 'root', 'Foo::Bar::Baz'

      root = Logging.logger.root
      foo = Logging.logger['Foo']
      fbb = Logging.logger['Foo::Bar::Baz']

      assert_not_same root, foo
      assert_not_same root, fbb
      assert_not_same foo, fbb

      assert_same root, Logging.logger[Hash]
      assert_same root, Logging.logger['ActiveRecord::Base']
      assert_same foo, Logging.logger['Foo::Bar']
      assert_same fbb, Logging.logger['Foo::Bar::Baz::Buz']
    end

  end  # class TestConsolidate
end  # module TestLogging

Version data entries

10 entries across 10 versions & 4 rubygems

Version Path
vagrant-unbundled-1.8.1.1 vendor/bundle/ruby/2.3.0/gems/logging-1.8.2/test/test_consolidate.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/logging-1.8.2/test/test_consolidate.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/logging-1.8.2/test/test_consolidate.rb
vagrant-tiktalik-0.0.3 vendor/bundle/ruby/2.0.0/gems/logging-1.8.1/test/test_consolidate.rb
logging-1.8.2 test/test_consolidate.rb
logging-1.8.1 test/test_consolidate.rb
logging-1.8.0 test/test_consolidate.rb
logging-1.7.2 test/test_consolidate.rb
logging-1.7.1 test/test_consolidate.rb
logging-1.7.0 test/test_consolidate.rb