Sha256: 0b83f0f17aadb2066419b76a1d3bc8cb77dc918b8f11ddf52b20adf1eaaf7031

Contents?: true

Size: 842 Bytes

Versions: 8

Compression:

Stored size: 842 Bytes

Contents

require 'spec_helper'

describe Killbill::Plugin::KillbillLogger do

  it 'should support Logger APIs' do
    logger = Killbill::Plugin::KillbillLogger.new(::Logger.new(STDOUT))
    logger.fatal { "Argument 'foo' not given." }
    logger.error "Argument #{@foo} mismatch."
    logger.info('initialize') { 'Initializing...' }
    logger.add(Logger::FATAL) { 'Fatal error!' }
    logger.close
  end

  it 'only executes block when at given level' do
    logger = Killbill::Plugin::KillbillLogger.new(::Logger.new(STDOUT))
    logger.log_level = ::Logger::INFO
    logger.info { 'logging at INFO level' }
    logger.debug { raise 'logging at DEBUG level' } # should not raise
    logger.add(Logger::WARN) { 'logging at WARN level' }
    logger.add(Logger::DEBUG) { raise 'logging at DEBUG level' } # should not raise
    logger.close
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
killbill-4.4.0 spec/killbill/killbill_logger_spec.rb
killbill-4.3.0 spec/killbill/killbill_logger_spec.rb
killbill-4.2.0 spec/killbill/killbill_logger_spec.rb
killbill-4.1.0 spec/killbill/killbill_logger_spec.rb
killbill-4.0.0 spec/killbill/killbill_logger_spec.rb
killbill-3.2.4 spec/killbill/killbill_logger_spec.rb
killbill-3.2.3 spec/killbill/killbill_logger_spec.rb
killbill-3.2.2 spec/killbill/killbill_logger_spec.rb