test/plugin/test_out_map.rb in fluent-plugin-map-0.0.6 vs test/plugin/test_out_map.rb in fluent-plugin-map-0.1.0

- old
+ new

@@ -55,15 +55,13 @@ #map is syntax error syntax_error_config = %[ map tag. ] - d1 = create_driver(syntax_error_config, tag) - es = Fluent::OneEventStream.new(time, record) - chain = Fluent::Test::TestOutputChain.new - e = d1.instance.emit(tag, es, chain) - assert e.kind_of?(SyntaxError) + assert_raise SyntaxError do + d1 = create_driver(syntax_error_config, tag) + end end def test_syntax_error2 tag = "tag" time = Time.local(2012, 10, 10, 10, 10, 0).to_i @@ -171,25 +169,22 @@ multi true ], tag } end - def test_timeout + def test_config_error_sleep tag = 'tag' time = Time.local(2012, 10, 10, 10, 10, 10).to_i record = {'code' => '300'} - d1 = create_driver %[ - key "newtag" - time sleep 10 - record record - timeout 1s - ], tag - d1.run do - d1.emit(record, time) - end - emits = d1.emits - assert_equal 0, emits.length + assert_raise(SyntaxError) { + create_driver %[ + key "newtag" + time sleep 10 + record record + timeout 1s + ], tag + } end # Add format test ## test format type (map, record, maps) ## test Backward compatibility without format