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.8.0 spec/lita/logger_spec.rb
lita-4.8.0.beta1 spec/lita/logger_spec.rb
lita-4.7.1 spec/lita/logger_spec.rb
lita-4.7.0 spec/lita/logger_spec.rb
lita-4.6.1 spec/lita/logger_spec.rb
lita-4.6.0 spec/lita/logger_spec.rb
lita-4.5.0 spec/lita/logger_spec.rb
lita-4.4.3 spec/lita/logger_spec.rb
lita-4.4.2 spec/lita/logger_spec.rb
lita-4.4.1 spec/lita/logger_spec.rb
lita-4.4.0 spec/lita/logger_spec.rb
lita-4.3.2 spec/lita/logger_spec.rb
lita-4.3.1 spec/lita/logger_spec.rb
lita-4.3.0 spec/lita/logger_spec.rb
lita-4.2.1 spec/lita/logger_spec.rb
lita-4.2.0 spec/lita/logger_spec.rb
lita-4.1.0 spec/lita/logger_spec.rb
lita-4.0.4 spec/lita/logger_spec.rb
lita-4.0.3 spec/lita/logger_spec.rb
lita-4.0.2 spec/lita/logger_spec.rb