Sha256: fe74e9b64e4bafe9ef98d744c45ae6d94efdd99d6d8c5a5f3b49c99a54b3596e

Contents?: true

Size: 810 Bytes

Versions: 4

Compression:

Stored size: 810 Bytes

Contents

require 'minitest/shared_description'

InMemoryAppenderHelper = shared_description do
  let :log_message do
    SemanticLogger.flush
    appender.message
  end

  let :appender do
    InMemoryAppender.new
  end

  let :thread_name do
    Thread.current.name
  end

  let :payload do
    {session_id: 'HSSKLEU@JDK767', tracking_number: 12_345}
  end

  let :logger do
    SemanticLogger['TestLogger']
  end

  let :appender_options do
    {appender: appender}
  end

  let :added_appender do
    SemanticLogger.add_appender(appender_options)
  end

  before do
    SemanticLogger.default_level   = :trace
    SemanticLogger.backtrace_level = :trace
    SemanticLogger.flush
    added_appender
  end

  after do
    SemanticLogger.appenders.each { |appender| SemanticLogger.remove_appender(appender) }
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
semantic_logger-4.3.1 test/in_memory_appender_helper.rb
semantic_logger-4.3.0 test/in_memory_appender_helper.rb
semantic_logger-4.2.2 test/in_memory_appender_helper.rb
semantic_logger-4.2.1 test/in_memory_appender_helper.rb