Sha256: 738e2cd4812987380f1dd7518a11189acbc16dcad9ff59fc7c79669d97282b8c

Contents?: true

Size: 844 Bytes

Versions: 6

Compression:

Stored size: 844 Bytes

Contents

require 'spec_helper'

describe Blather do
  
  describe "while accessing to Logger object" do
    it "should return a Logger instance" do
      Blather.logger.must_be_instance_of Logger
    end

    it "should config log level to info by default" do
      Blather.logger.level.must_equal 1
    end
  end

  describe "while using the log method" do
    after do
      Blather.default_log_level = :debug
    end

    it "should forward to debug by default" do
      Blather.logger.expects(:debug).with("foo bar").once
      Blather.log "foo bar"
    end
    
    %w<debug info error fatal>.each do |val|
      it "should forward to #{val} if configured that default level" do
        Blather.logger.expects(val.to_sym).with("foo bar").once
        Blather.default_log_level = val.to_sym
        Blather.log "foo bar"
      end
    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
blather-0.6.2 spec/blather_spec.rb
blather-0.6.1 spec/blather_spec.rb
blather-0.6.0 spec/blather_spec.rb
blather-0.5.12 spec/blather_spec.rb
blather-0.5.11 spec/blather_spec.rb
blather-0.5.10 spec/blather_spec.rb