Sha256: 2e22f35c1af87152adc301953aefbd815dd2c87820f972bc45feaa257e6fddc5

Contents?: true

Size: 1.04 KB

Versions: 3

Compression:

Stored size: 1.04 KB

Contents

require "include"
require "runit/cui/testrunner"

# tests the customization of Log4r levels
class TestCustom < TestCase
  def test_validation
    assert_exception(TypeError) { Configurator.custom_levels "lowercase" }
    assert_exception(TypeError) { Configurator.custom_levels "With space" }
  end

  def test_create
    assert_no_exception { Configurator.custom_levels "Foo", "Bar", "Baz" }
    assert_no_exception { Configurator.custom_levels }
    assert_no_exception { Configurator.custom_levels "Bogus", "Levels" }
  end
  def test_methods
    l = Logger.new 'custom1'
    assert_respond_to(:foo, l)
    assert_respond_to(:foo?, l)
    assert_respond_to(:bar, l)
    assert_respond_to(:bar?, l)
    assert_respond_to(:baz, l)
    assert_respond_to(:baz?, l)
    assert_no_exception(NameError) { Bar }
    assert_no_exception(NameError) { Baz }
    assert_no_exception(NameError) { Foo }
  end
    
end

CUI::TestRunner.run(TestCustom.new("test_validation"))
CUI::TestRunner.run(TestCustom.new("test_create"))
CUI::TestRunner.run(TestCustom.new("test_methods"))

Version data entries

3 entries across 3 versions & 3 rubygems

Version Path
revolutionhealth-log4r-2.0.0 test/orig_tests/testcustom.rb
sml-log4r-1.0.6 tests/testcustom.rb
riess-0.0.8 vendor/log4r-1.0.5/tests/testcustom.rb