test/test_out_s3.rb in fluent-plugin-s3-0.4.3 vs test/test_out_s3.rb in fluent-plugin-s3-0.5.0

- old
+ new

@@ -40,36 +40,36 @@ assert_equal 'test_key_id', d.instance.aws_key_id assert_equal 'test_sec_key', d.instance.aws_sec_key assert_equal 'test_bucket', d.instance.s3_bucket assert_equal 'log', d.instance.path assert d.instance.instance_variable_get(:@use_ssl) - assert_equal 'gz', d.instance.instance_variable_get(:@ext) - assert_equal 'application/x-gzip', d.instance.instance_variable_get(:@mime_type) + assert_equal 'gz', d.instance.instance_variable_get(:@compressor).ext + assert_equal 'application/x-gzip', d.instance.instance_variable_get(:@compressor).content_type end def test_configure_with_mime_type_json conf = CONFIG.clone conf << "\nstore_as json\n" d = create_driver(conf) - assert_equal 'json', d.instance.instance_variable_get(:@ext) - assert_equal 'application/json', d.instance.instance_variable_get(:@mime_type) + assert_equal 'json', d.instance.instance_variable_get(:@compressor).ext + assert_equal 'application/json', d.instance.instance_variable_get(:@compressor).content_type end def test_configure_with_mime_type_text conf = CONFIG.clone conf << "\nstore_as text\n" d = create_driver(conf) - assert_equal 'txt', d.instance.instance_variable_get(:@ext) - assert_equal 'text/plain', d.instance.instance_variable_get(:@mime_type) + assert_equal 'txt', d.instance.instance_variable_get(:@compressor).ext + assert_equal 'text/plain', d.instance.instance_variable_get(:@compressor).content_type end def test_configure_with_mime_type_lzo conf = CONFIG.clone conf << "\nstore_as lzo\n" d = create_driver(conf) - assert_equal 'lzo', d.instance.instance_variable_get(:@ext) - assert_equal 'application/x-lzop', d.instance.instance_variable_get(:@mime_type) + assert_equal 'lzo', d.instance.instance_variable_get(:@compressor).ext + assert_equal 'application/x-lzop', d.instance.instance_variable_get(:@compressor).content_type rescue => e # TODO: replace code with disable lzop command assert(e.is_a?(Fluent::ConfigError)) end @@ -145,25 +145,11 @@ d.expect_format %[{"a":2}\n] d.run end - def test_format_with_format_json_deprecated - config = [CONFIG, 'format_json true'].join("\n") - d = create_driver(config) - - time = Time.parse("2011-01-02 13:14:15 UTC").to_i - d.emit({"a"=>1}, time) - d.emit({"a"=>2}, time) - - d.expect_format %[{"a":1}\n] - d.expect_format %[{"a":2}\n] - - d.run - end - def test_format_with_format_json_included_tag - config = [CONFIG, 'format_json true', 'include_tag_key true'].join("\n") + config = [CONFIG, 'format json', 'include_tag_key true'].join("\n") d = create_driver(config) time = Time.parse("2011-01-02 13:14:15 UTC").to_i d.emit({"a"=>1}, time) d.emit({"a"=>2}, time)