Sha256: 201c2f37072e9f80cd4e49ce2e764b4fce414912abb1f59695d21e7a94694dbe

Contents?: true

Size: 836 Bytes

Versions: 4

Compression:

Stored size: 836 Bytes

Contents

# Copyright (c) 2011 - 2013, SoundCloud Ltd.

require File.expand_path(File.dirname(__FILE__)) + '/unit_helper'

describe Lhm do

  before(:each) do
    Lhm.remove_class_variable :@@logger if Lhm.class_variable_defined? :@@logger
  end

  describe 'logger' do

    it 'should use the default parameters if no logger explicitly set' do
      Lhm.logger.must_be_kind_of Logger
      Lhm.logger.level.must_equal Logger::INFO
      Lhm.logger.instance_eval { @logdev }.dev.must_equal STDOUT
    end

    it 'should use s new logger if set' do
      l = Logger.new('omg.ponies')
      l.level = Logger::ERROR
      Lhm.logger = l

      Lhm.logger.level.must_equal Logger::ERROR
      Lhm.logger.instance_eval { @logdev }.dev.must_be_kind_of File
      Lhm.logger.instance_eval { @logdev }.dev.path.must_equal 'omg.ponies'
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
lhm-shopify-3.4.0 spec/unit/lhm_spec.rb
lhm-shopify-3.3.6 spec/unit/lhm_spec.rb
lhm-shopify-3.3.5 spec/unit/lhm_spec.rb
lhm-2.2.0 spec/unit/lhm_spec.rb