Sha256: 79b14cfd9fae441bb35d56d5a6e201be9171db6cd1f18a52f1d3240490e98aee

Contents?: true

Size: 1006 Bytes

Versions: 2

Compression:

Stored size: 1006 Bytes

Contents

# $Id: setup.rb 39 2007-10-26 20:22:01Z tim_pease $

require 'test/unit'

begin
  require 'logging'
rescue LoadError
  path = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
  raise if $:.include? path
  $: << path
  retry
end

begin
  require 'turn'
rescue LoadError
  require 'rubygems'
  begin; require 'turn'; rescue LoadError; end
end


module TestLogging
module LoggingTestCase

  def setup
    super

    ::Logging.module_eval do
      ::Logging::LEVELS.clear
      ::Logging::LNAMES.clear
      remove_const :MAX_LEVEL_LENGTH if const_defined? :MAX_LEVEL_LENGTH
      remove_const :OBJ_FORMAT if const_defined? :OBJ_FORMAT
    end

    ::Logging::Repository.class_eval do
      @__instance__ = nil
      class << self
        nonce = class << Singleton; self; end
        define_method(:instance, nonce::FirstInstanceCall)
      end
    end
    
    ::Logging::Appender.instance_variable_get(:@appenders).clear
  end

end  # module LoggingTestCase
end  # module TestLogging

# EOF

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
logging-0.5.0 test/setup.rb
logging-0.5.1 test/setup.rb