test/test_logger.rb in logging-0.1.0 vs test/test_logger.rb in logging-0.2.0
- old
+ new
@@ -1,6 +1,6 @@
-# $Id: test_logger.rb 15 2007-01-15 19:03:45Z tim_pease $
+# $Id: test_logger.rb 22 2007-01-29 16:20:54Z tim_pease $
require 'test/setup.rb'
require 'stringio'
module TestLogging
@@ -67,10 +67,24 @@
assert_raise(NoMethodError) {root.additive = false}
assert_equal true, log.additive
log.additive = false
assert_equal false, log.additive
+
+ log.additive = true
+ assert_equal true, log.additive
+
+ log.additive = 'false'
+ assert_equal false, log.additive
+
+ log.additive = 'true'
+ assert_equal true, log.additive
+
+ log.additive = nil
+ assert_equal true, log.additive
+
+ assert_raise(ArgumentError) {log.additive = Object}
end
def test_appenders_eq
log = ::Logging::Logger.new '42'
@@ -440,9 +454,31 @@
log = ::Logging::Logger['A']
assert_equal false, log.trace
log.trace = true
assert_equal true, log.trace
+ end
+
+ def test_trace_eq
+ log = ::Logging::Logger.new 'A'
+ assert_equal false, log.trace
+
+ log.trace = true
+ assert_equal true, log.trace
+
+ log.trace = false
+ assert_equal false, log.trace
+
+ log.trace = 'true'
+ assert_equal true, log.trace
+
+ log.trace = 'false'
+ assert_equal false, log.trace
+
+ log.trace = nil
+ assert_equal false, log.trace
+
+ assert_raise(ArgumentError) {log.trace = Object}
end
end # class TestLogger
class SioAppender < ::Logging::Appenders::IO