test/plugin/test_out_flume.rb in fluent-plugin-flume-0.1.3 vs test/plugin/test_out_flume.rb in fluent-plugin-flume-0.2.0

- old
+ new

@@ -39,49 +39,48 @@ time = Time.parse("2011-12-21 13:14:15 UTC").to_i d = create_driver d.emit({"k11"=>"v11", "k12"=>"v12"}, time) d.emit({"k21"=>"v21", "k22"=>"v22"}, time) - puts ({"k11" => "v11", "k12" => "v12"}.to_json) - d.expect_format [d.tag, time, {"k11"=>"v11", "k12"=>"v12"}.to_json].to_msgpack - d.expect_format [d.tag, time, {"k21"=>"v21", "k22"=>"v22"}.to_json].to_msgpack + d.expect_format [time, {"k11"=>"v11", "k12"=>"v12"}.to_json].to_msgpack + d.expect_format [time, {"k21"=>"v21", "k22"=>"v22"}.to_json].to_msgpack d.run d = create_driver(CONFIG + %[ remove_prefix test ], 'test.flumeplugin') assert_equal 'test.flumeplugin', d.tag d.emit({"k11"=>"v11", "k12"=>"v12"}, time) d.emit({"k21"=>"v21", "k22"=>"v22"}, time) - d.expect_format ['flumeplugin', time, {"k11"=>"v11", "k12"=>"v12"}.to_json].to_msgpack - d.expect_format ['flumeplugin', time, {"k21"=>"v21", "k22"=>"v22"}.to_json].to_msgpack + d.expect_format [time, {"k11"=>"v11", "k12"=>"v12"}.to_json].to_msgpack + d.expect_format [time, {"k21"=>"v21", "k22"=>"v22"}.to_json].to_msgpack d.run d = create_driver(CONFIG + %[ remove_prefix test ], 'xxx.test.flumeplugin') assert_equal 'xxx.test.flumeplugin', d.tag d.emit({"k11"=>"v11", "k12"=>"v12"}, time) - d.expect_format ['xxx.test.flumeplugin', time, {"k11"=>"v11", "k12"=>"v12"}.to_json].to_msgpack + d.expect_format [time, {"k11"=>"v11", "k12"=>"v12"}.to_json].to_msgpack d.run d = create_driver(CONFIG + %[ remove_prefix test ], 'test') assert_equal 'test', d.tag d.emit({"k11"=>"v11", "k12"=>"v12"}, time) - d.expect_format ['unknown', time, {"k11"=>"v11", "k12"=>"v12"}.to_json].to_msgpack + d.expect_format [time, {"k11"=>"v11", "k12"=>"v12"}.to_json].to_msgpack d.run d = create_driver(CONFIG + %[ remove_prefix test ], 'test.flumeplugin') assert_equal 'test.flumeplugin', d.tag d.emit({"k11"=>"v11", "k12"=>"v12"}, time) d.emit({"k21"=>"v21", "k22"=>"v22"}, time) - d.expect_format ['flumeplugin', time, {"k11"=>"v11", "k12"=>"v12"}.to_json].to_msgpack - d.expect_format ['flumeplugin', time, {"k21"=>"v21", "k22"=>"v22"}.to_json].to_msgpack + d.expect_format [time, {"k11"=>"v11", "k12"=>"v12"}.to_json].to_msgpack + d.expect_format [time, {"k21"=>"v21", "k22"=>"v22"}.to_json].to_msgpack d.run end def test_write time = Time.parse("2011-12-21 13:14:15 UTC").to_i