Sha256: 025a98918a740f3baf4c9107f5d936c8d3a16c1136ae2b1f68388bb6bb7af669

Contents?: true

Size: 683 Bytes

Versions: 5

Compression:

Stored size: 683 Bytes

Contents

$: << File.join("..","src")
require "test/unit"
require "log4r"
include Log4r

class TestNDC < Test::Unit::TestCase

  def test_ndc_remove_push
    NDC.remove()
    NDC.push("ndc")
    assert(Log4r::NDC.get() == "ndc", "Expected 'ndc' got '#{NDC.get()}'" )
    NDC.push("ndc")
    assert(Log4r::NDC.get() == "ndc ndc", "Expected 'ndc ndc' got '#{NDC.get()}'" )
  end

  def test_ndc_remove_push_clone_and_inherit
    NDC.remove()
    NDC.push("ndc")
    NDC.push("ndc")
    a = NDC.clone_stack()
    NDC.remove()
    assert(NDC.get() == "", "Expected '' got '#{NDC.get()}'" )
    NDC.inherit(a)
    assert(NDC.get() == "ndc ndc", "Expected 'ndc ndc' got '#{NDC.get()}'" )
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
log4r-1.1.7 tests/testNDC.rb
log4r-1.1.6 tests/testNDC.rb
log4r-1.1.5 tests/testNDC.rb
log4r-1.1.4 tests/testNDC.rb
log4r-1.1.3 tests/testNDC.rb