Sha256: e61cbecaa0f1ff4b8190577df0b3dcfeb5a4c8f861c39f011d955aad07f13d6e

Contents?: true

Size: 733 Bytes

Versions: 33

Compression:

Stored size: 733 Bytes

Contents

require "spec_helper"

describe Lita::Logger do
  it "uses a custom log level" do
    logger = described_class.get_logger(:debug)
    expect(logger.level).to eq(Logger::DEBUG)
  end

  it "uses the info level if the config is nil" do
    logger = described_class.get_logger(nil)
    expect(logger.level).to eq(Logger::INFO)
  end

  it "uses the info level if the config level is invalid" do
    logger = described_class.get_logger(:foo)
    expect(logger.level).to eq(Logger::INFO)
  end

  it "logs messages with a custom format" do
    stderr = StringIO.new
    stub_const("STDERR", stderr)
    logger = described_class.get_logger(:debug)
    logger.fatal "foo"
    expect(stderr.string).to match(/^\[.+\] FATAL: foo$/)
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
lita-4.0.1 spec/lita/logger_spec.rb
lita-4.0.0 spec/lita/logger_spec.rb
lita-4.0.0.rc2 spec/lita/logger_spec.rb
lita-4.0.0.rc1 spec/lita/logger_spec.rb
lita-3.3.1 spec/lita/logger_spec.rb
lita-3.3.0 spec/lita/logger_spec.rb
lita-3.2.0 spec/lita/logger_spec.rb
lita-3.1.0 spec/lita/logger_spec.rb
lita-3.0.4 spec/lita/logger_spec.rb
lita-3.0.3 spec/lita/logger_spec.rb
lita-3.0.2 spec/lita/logger_spec.rb
lita-3.0.1 spec/lita/logger_spec.rb
lita-3.0.0 spec/lita/logger_spec.rb