Sha256: b7f6c667537fafd2181e210dc97246ffe64d2edd68ea6c21fb071795ec33d034

Contents?: true

Size: 810 Bytes

Versions: 1

Compression:

Stored size: 810 Bytes

Contents

require File.join(File.dirname(__FILE__), "test_helper.rb")

class TermiteExtraLoggerTest < Scope::TestCase
  context "with termite" do
    setup do
      $0 = "MyApp"
      Ecology.reset
    end

    context "and two extra loggers added" do
      setup do
        @logger = Termite::Logger.new("/tmp/test_log_output.txt")  # Test with output file
        @logger.level = Logger::DEBUG
        Syslog.expects(:open)
        @mock_logger_1 = mock()
        @mock_logger_2 = mock()
        @logger.add_logger(@mock_logger_1)
        @logger.add_logger(@mock_logger_2)
      end

      should "correctly send logs to additional loggers" do
        @mock_logger_1.expects(:<<).with("foo!")
        @mock_logger_2.expects(:<<).with("foo!")
        @logger.add(Logger::FATAL, "foo!", {})
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
termite-0.0.20 test/extra_logger_test.rb