Sha256: dc7a031eb190cd12fb99d44f5ac8867f066b5785d99667e4fe4f210f5a41f2a5

Contents?: true

Size: 803 Bytes

Versions: 9

Compression:

Stored size: 803 Bytes

Contents

# Equivalent to a header guard in C/C++
# Used to prevent the class/module from being loaded more than once
unless defined? LOGGING_TEST_SETUP
LOGGING_TEST_SETUP = true

require "rubygems"
require "test/unit"
require "tmpdir"

LOGGING_TEST_TMPDIR = Dir.mktmpdir("logging")
Test::Unit.at_exit do
  FileUtils.remove_entry(LOGGING_TEST_TMPDIR)
end

if Test::Unit::TestCase.respond_to? :test_order=
  Test::Unit::TestCase.test_order = :random
end

require File.expand_path("../../lib/logging", __FILE__)

module TestLogging
  module LoggingTestCase

    def setup
      super
      Logging.reset
      @tmpdir = LOGGING_TEST_TMPDIR
      FileUtils.rm_rf(Dir.glob(File.join(@tmpdir, "*")))
    end

    def teardown
      super
      FileUtils.rm_rf(Dir.glob(File.join(@tmpdir, "*")))
    end
  end
end

end

Version data entries

9 entries across 8 versions & 2 rubygems

Version Path
logging-2.4.0 test/setup.rb
logging-2.3.1 test/setup.rb
vagrant-unbundled-2.2.19.0 vendor/bundle/ruby/3.0.0/gems/logging-2.3.0/test/setup.rb
vagrant-unbundled-2.2.18.0 vendor/bundle/ruby/3.0.0/gems/logging-2.3.0/test/setup.rb
vagrant-unbundled-2.2.16.0 vendor/bundle/ruby/2.7.0/gems/logging-2.3.0/test/setup.rb
vagrant-unbundled-2.2.16.0 vendor/bundle/ruby/3.0.0/gems/logging-2.3.0/test/setup.rb
vagrant-unbundled-2.2.14.0 vendor/bundle/ruby/2.7.0/gems/logging-2.3.0/test/setup.rb
vagrant-unbundled-2.2.10.0 vendor/bundle/ruby/2.7.0/gems/logging-2.3.0/test/setup.rb
logging-2.3.0 test/setup.rb