File: testcustom.rb

package info (click to toggle)
ruby-log4r 1.1.10-4.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid, trixie
  • size: 648 kB
  • sloc: ruby: 2,744; xml: 96; makefile: 5
file content (30 lines) | stat: -rw-r--r-- 877 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
require 'test_helper'

# tests the customization of Log4r levels
class TestCustom < TestCase
  include Log4r

  def test_validation
    assert_raise(TypeError) { Configurator.custom_levels "lowercase" }
    assert_raise(TypeError) { Configurator.custom_levels "With space" }
  end

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

end