test/test_logging.rb in logging-2.1.0 vs test/test_logging.rb in logging-2.2.0
- old
+ new
@@ -37,9 +37,37 @@
assert_equal true, ::Logging.backtrace
assert_raise(ArgumentError) {::Logging.backtrace 'foo'}
end
+ def test_utc_offset
+ assert_nil ::Logging.utc_offset
+
+ ::Logging.utc_offset = 0
+ assert_equal 0, ::Logging.utc_offset
+
+ ::Logging.utc_offset = "UTC"
+ assert_equal 0, ::Logging.utc_offset
+
+ ::Logging.utc_offset = "+01:00"
+ assert_equal "+01:00", ::Logging.utc_offset
+
+ assert_raise(ArgumentError) {::Logging.utc_offset = "06:00"}
+ end
+
+ def test_basepath
+ assert_nil ::Logging.basepath
+
+ ::Logging.basepath = ""
+ assert_nil ::Logging.basepath
+
+ ::Logging.basepath = "./"
+ assert_equal File.expand_path("../../", __FILE__), ::Logging.basepath
+
+ ::Logging.reset
+ assert_nil ::Logging.basepath
+ end
+
def test_logger
assert_raise(TypeError) {::Logging.logger []}
logger = ::Logging.logger STDOUT
assert_match %r/\A-?\d+\z/, logger.name