test/glue/tc_logger.rb in glue-0.20.0 vs test/glue/tc_logger.rb in glue-0.21.0
- old
+ new
@@ -6,38 +6,38 @@
require 'test/unit'
require 'glue/logger'
class TC_Logger < Test::Unit::TestCase # :nodoc: all
- def setup
- @io = StringIO.new('')
- Logger.set(Logger.new(@io))
- end
+ def setup
+ @io = StringIO.new('')
+ Logger.set(Logger.new(@io))
+ end
- def test_logger
- Logger.info 'hello'
- assert_equal(" INFO: hello\n", @io.string)
+ def test_logger
+ Logger.info 'hello'
+ assert_equal(" INFO: hello\n", @io.string)
- # bug: Binding.of_caller thinks Logger is the caller.
- a = 14
- b = 13
- Logger.trace 'a * b'
- assert_equal(" INFO: hello\nDEBUG: a * b = 182\n", @io.string)
-
- @io.string = ''
- Logger.debug 'hello'
- assert_equal("DEBUG: hello\n", @io.string)
+ # bug: Binding.of_caller thinks Logger is the caller.
+ a = 14
+ b = 13
+ Logger.trace 'a * b'
+ assert_equal(" INFO: hello\nDEBUG: a * b = 182\n", @io.string)
+
+ @io.string = ''
+ Logger.debug 'hello'
+ assert_equal("DEBUG: hello\n", @io.string)
- # test logging level.
- Logger.get.level = Logger::INFO
- Logger.debug 'world'
- assert_equal("DEBUG: hello\n", @io.string)
+ # test logging level.
+ Logger.get.level = Logger::INFO
+ Logger.debug 'world'
+ assert_equal("DEBUG: hello\n", @io.string)
- # bug:
- Logger.error 'Have forgotten that :)'
-
- #
- Logger.set('hello.log')
- assert_instance_of(Logger, Logger.get)
- end
+ # bug:
+ Logger.error 'Have forgotten that :)'
+
+ #
+ Logger.set('hello.log')
+ assert_instance_of(Logger, Logger.get)
+ end
end