test/unit/slf4j/logger_test.rb in loggr-1.1.1 vs test/unit/slf4j/logger_test.rb in loggr-1.1.2

- old
+ new

@@ -144,9 +144,16 @@ assert_equal({ "user" => "demo" }, @logger.java_mdc.to_hash) end assert_equal Hash.new, @logger.java_mdc.to_hash end + def test_strip_leading_newlines + skip_unless_jruby + assert_equal " some\nnewline\nmessage", @logger.send(:build_message, " some\nnewline\nmessage") + assert_equal "Started GET \"/service/dossiers\" for 127.0.0.1 at Wed Feb 15 22:28:02 +0100 2012", @logger.send(:build_message, "\n\nStarted GET \"/service/dossiers\" for 127.0.0.1 at Wed Feb 15 22:28:02 +0100 2012") + assert_equal "NoMethodError (missing foobar):\n backtrace1\n backtrace2\n\n", @logger.send(:build_message, "\n\nNoMethodError (missing foobar):\n backtrace1\n backtrace2\n\n") + end + def test_java_logger skip_unless_jruby refute_nil @logger.java_logger assert_kind_of Java::OrgSlf4j::Logger, @logger.java_logger end \ No newline at end of file