test/plugin/test_out_mackerel.rb in fluent-plugin-mackerel-0.0.5 vs test/plugin/test_out_mackerel.rb in fluent-plugin-mackerel-0.0.6

- old
+ new

@@ -35,10 +35,19 @@ metrics_name service.${out_key} out_keys val1,val2,val3 flush_interval 1s ] + CONFIG_ORIGIN = %[ + type mackerel + api_key 123456 + hostid xyz + metrics_name service.${out_key} + out_keys val1,val2,val3 + origin example.domain + ] + def create_driver(conf = CONFIG, tag='test') Fluent::Test::BufferedOutputTestDriver.new(Fluent::MackerelOutput, tag).configure(conf) end def test_configure @@ -55,9 +64,12 @@ d = create_driver(CONFIG_BLANK_METRICS) } d = create_driver(CONFIG_SMALL_FLUSH_INTERVAL) assert_equal d.instance.instance_variable_get(:@flush_interval), 60 + + d = create_driver(CONFIG_ORIGIN) + assert_equal d.instance.instance_variable_get(:@origin), 'example.domain' d = create_driver() assert_equal d.instance.instance_variable_get(:@api_key), '123456' assert_equal d.instance.instance_variable_get(:@hostid), 'xyz' assert_equal d.instance.instance_variable_get(:@metrics_name), 'service.${out_key}'