Sha256: 1926344d7cdf9b61583417d2269e5a9a60504f7e55eac3fdfdd90d178af57c13

Contents?: true

Size: 754 Bytes

Versions: 1

Compression:

Stored size: 754 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
        @logger.socket.expects(:send)
        @mock_logger_1 = mock()
        @logger.add_logger(@mock_logger_1)
        @logger.add_logger(@mock_logger_2)
      end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
termite-0.0.10 test/extra_logger_test.rb