Sha256: 0a9b456a424dc1b1b7169f15d1640fc3a62fea0073f2d1dce127c0564436e402

Contents?: true

Size: 841 Bytes

Versions: 51

Compression:

Stored size: 841 Bytes

Contents

require 'spec_helper'

describe RightSupport::Log::NullLogger do
  before(:each) do
    @logger = RightSupport::Log::NullLogger.new
  end

  context 'log levels' do
    [:debug, :info, :warn, :error, :fatal].each do |method|
      it "responds to ##{method}" do
        block_called = false
        @logger.__send__(method, 'lalalala').should be_true
        @logger.__send__(method) { block_called = true ; 'lalalala' }.should be_true
        block_called.should be_true
      end
    end
  end

  context '<< method' do
    it 'responds like Logger' do
      (@logger << 'lalalala').should == 8
    end
  end

  context :close do
    it 'responds' do
      @logger.close.should be_nil
    end

    it 'is idempotent' do
      @logger.close.should be_nil
      @logger.close.should be_nil
      @logger.close.should be_nil
    end
  end
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
right_support-2.11.3 spec/log/null_logger_spec.rb
right_support-2.11.2 spec/log/null_logger_spec.rb
right_support-2.10.1 spec/log/null_logger_spec.rb
right_support-2.9.6 spec/log/null_logger_spec.rb
right_support-2.9.5 spec/log/null_logger_spec.rb
right_support-2.9.4 spec/log/null_logger_spec.rb
right_support-2.9.3 spec/log/null_logger_spec.rb
right_support-2.9.2 spec/log/null_logger_spec.rb
right_support-2.9.1 spec/log/null_logger_spec.rb
right_support-2.8.46 spec/log/null_logger_spec.rb
right_support-2.8.45 spec/log/null_logger_spec.rb
right_support-2.8.44 spec/log/null_logger_spec.rb
right_support-2.8.43 spec/log/null_logger_spec.rb
right_support-2.8.42 spec/log/null_logger_spec.rb
right_support-2.8.41 spec/log/null_logger_spec.rb
right_support-2.8.40 spec/log/null_logger_spec.rb
right_support-2.8.39 spec/log/null_logger_spec.rb
right_support-2.8.38 spec/log/null_logger_spec.rb
right_support-2.8.37 spec/log/null_logger_spec.rb
right_support-2.8.36 spec/log/null_logger_spec.rb