Sha256: caf3e544e508bc69bead00a80246818198f64d234e0e00d330ac83487b547401

Contents?: true

Size: 840 Bytes

Versions: 8

Compression:

Stored size: 840 Bytes

Contents

require 'spec_helper'

describe Blather do

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

    it "should config log level to info by default" do
      Blather.logger.level.should == 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

8 entries across 8 versions & 1 rubygems

Version Path
blather-1.0.0 spec/blather_spec.rb
blather-0.8.8 spec/blather_spec.rb
blather-0.8.7 spec/blather_spec.rb
blather-0.8.6 spec/blather_spec.rb
blather-0.8.5 spec/blather_spec.rb
blather-0.8.4 spec/blather_spec.rb
blather-0.8.3 spec/blather_spec.rb
blather-0.8.2 spec/blather_spec.rb