Sha256: 5c6c9ae7e86eb38fc54a6e0ae60db5eea8a965977845ed79e5b53315e73f88e2

Contents?: true

Size: 964 Bytes

Versions: 4

Compression:

Stored size: 964 Bytes

Contents

# $Id: setup.rb 22 2007-01-29 16:20:54Z tim_pease $

require 'test/unit'

begin
  require 'logging'
rescue LoadError
  require 'rubygems'
  require 'logging'
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

4 entries across 4 versions & 1 rubygems

Version Path
logging-0.2.0 test/setup.rb
logging-0.3.0 test/setup.rb
logging-0.3.1 test/setup.rb
logging-0.4.0 test/setup.rb