test/test_layout.rb in logging-1.7.2 vs test/test_layout.rb in logging-1.8.0
- old
+ new
@@ -24,10 +24,13 @@
assert_equal :string, obj_format[@layout]
@layout = ::Logging::Layout.new :format_as => :inspect
assert_equal :inspect, obj_format[@layout]
+ @layout = ::Logging::Layout.new 'format_as' => :json
+ assert_equal :json, obj_format[@layout]
+
@layout = ::Logging::Layout.new 'format_as' => :yaml
assert_equal :yaml, obj_format[@layout]
@layout = ::Logging::Layout.new
assert_equal :string, obj_format[@layout]
@@ -70,9 +73,13 @@
obj = %w( one two three four )
@layout = ::Logging::Layout.new :format_as => :inspect
r = @layout.format_obj obj
assert_equal '<Array> ["one", "two", "three", "four"]', r
+
+ @layout = ::Logging::Layout.new :format_as => :json
+ r = @layout.format_obj obj
+ assert_equal '<Array> ["one","two","three","four"]', r
@layout = ::Logging::Layout.new :format_as => :yaml
r = @layout.format_obj obj
assert_match %r/\A<Array> \n--- ?\n- one\n- two\n- three\n- four\n/, r