Sha256: 4d2f8450c0c8f5986015b9c94d02f321925c10b68829ecca196ce3d245502f5e

Contents?: true

Size: 743 Bytes

Versions: 14

Compression:

Stored size: 743 Bytes

Contents

require_relative '../test_helper'
require 'logster/logger'
require 'logger'

class NullStore
  def report(severity,progname,message,options=nil)
  end
end

class TestLogger < Minitest::Test

  def setup
    @logger = Logster::Logger.new(NullStore.new)
  end

  def teardown
  end

  def test_chain
    io = StringIO.new
    @logger.chain Logger.new(io)
    @logger.warn "boom"

    assert_match(/W,.*boom/, io.string)
  end

  class PlayLogger
    attr_accessor :skip_store
    def initialize(tester)
      @tester = tester
    end

    def add(s,m,p,&block)
      @tester.assert(skip_store)
    end
  end

  def test_chain_with_ignore
    @logger.chain PlayLogger.new(self)
    @logger.skip_store = true
    @logger.warn("testing")
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
logster-1.0.0.2.pre test/logster/test_logger.rb
logster-1.0.0.1.pre test/logster/test_logger.rb
logster-1.0.0.0.pre test/logster/test_logger.rb
logster-0.9.9 test/logster/test_logger.rb
logster-0.8.4.8.pre test/logster/test_logger.rb
logster-0.8.4.7.pre test/logster/test_logger.rb
logster-0.8.4.6.pre test/logster/test_logger.rb
logster-0.8.4.5.pre test/logster/test_logger.rb
logster-0.8.4.4.pre test/logster/test_logger.rb
logster-0.8.4.3.pre test/logster/test_logger.rb
logster-0.8.4.2.pre test/logster/test_logger.rb
logster-0.8.4.1.pre test/logster/test_logger.rb
logster-0.8.4.pre test/logster/test_logger.rb
logster-0.8.3 test/logster/test_logger.rb