test/test_layout.rb in logging-0.1.0 vs test/test_layout.rb in logging-0.2.0

- old
+ new

@@ -1,6 +1,6 @@ -# $Id: test_layout.rb 5 2007-01-09 23:02:57Z tim_pease $ +# $Id: test_layout.rb 17 2007-01-20 18:47:43Z tim_pease $ require 'test/setup.rb' module TestLogging @@ -19,17 +19,17 @@ def test_initialize obj_format = lambda {|l| l.instance_variable_get :@obj_format} assert_equal :string, obj_format[@layout] - @layout = ::Logging::Layout.new 'blah' + @layout = ::Logging::Layout.new 'format_as' => 'blah' assert_equal :string, obj_format[@layout] - @layout = ::Logging::Layout.new :inspect + @layout = ::Logging::Layout.new :format_as => :inspect assert_equal :inspect, obj_format[@layout] - @layout = ::Logging::Layout.new :yaml + @layout = ::Logging::Layout.new 'format_as' => :yaml assert_equal :yaml, obj_format[@layout] @layout = ::Logging::Layout.new assert_equal :string, obj_format[@layout] @@ -68,18 +68,18 @@ obj = [1, 2, 3, 4] r = @layout.send :format_obj, obj assert_equal '<Array> 1234', r obj = %w( one two three four ) - @layout = ::Logging::Layout.new :inspect + @layout = ::Logging::Layout.new :format_as => :inspect r = @layout.send :format_obj, obj assert_equal '<Array> ["one", "two", "three", "four"]', r - @layout = ::Logging::Layout.new :yaml + @layout = ::Logging::Layout.new :format_as => :yaml r = @layout.send :format_obj, obj assert_equal "<Array> \n--- \n- one\n- two\n- three\n- four\n", r end - end # class TestAppender + end # class TestLayout end # module TestLogging # EOF