Sha256: 7e42538882b36587c33149c31d6dfc7c9d3db2c1207ad80cc5928b10c943ce97

Contents?: true

Size: 1.14 KB

Versions: 27

Compression:

Stored size: 1.14 KB

Contents

require File.join(File.dirname(__FILE__), %w[setup])

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

# EOF

Version data entries

27 entries across 27 versions & 5 rubygems

Version Path
TwP-logging-1.1.0 test/test_consolidate.rb
TwP-logging-1.1.1 test/test_consolidate.rb
TwP-logging-1.1.2 test/test_consolidate.rb
TwP-logging-1.1.3 test/test_consolidate.rb
TwP-logging-1.1.4 test/test_consolidate.rb
TwP-logging-1.2.0 test/test_consolidate.rb
TwP-logging-1.2.2 test/test_consolidate.rb
pjstadig-logging-1.1.4.1 test/test_consolidate.rb
logging-1.4.3 test/test_consolidate.rb
sgeorgi-logging-1.4.2 test/test_consolidate.rb
logging-1.4.2 test/test_consolidate.rb
logging-1.4.1 test/test_consolidate.rb
logging-1.4.0 test/test_consolidate.rb
redcar-0.3.1dev lib/logging/test/test_consolidate.rb
redcar-0.3.0dev lib/logging/test/test_consolidate.rb
logging-1.3.0 test/test_consolidate.rb
redcar-0.2.9dev lib/logging/test/test_consolidate.rb
pjstadig-logging-1.1.4.2 test/test_consolidate.rb
logging-1.2.3 test/test_consolidate.rb
logging-1.2.2 test/test_consolidate.rb