diff --git a/test/plugin/test_in_dummy.rb b/test/plugin/test_in_dummy.rb index d9c0db7618..35b9fd12a5 100644 --- a/test/plugin/test_in_dummy.rb +++ b/test/plugin/test_in_dummy.rb @@ -107,7 +107,7 @@ def create_driver(conf) test "value of auto increment key is not suspended after stop-and-start" do assert !File.exist?(File.join(TEST_PLUGIN_STORAGE_PATH, 'json', 'test-01.json')) - d1 = create_driver(conf1) + d1 = Fluent::Test::InputTestDriver.new(Fluent::Plugin::DummyInput).configure(conf1) d1.expected_emits_length = 4 d1.run @@ -119,12 +119,12 @@ def create_driver(conf) assert !File.exist?(File.join(TEST_PLUGIN_STORAGE_PATH, 'json', 'test-01.json')) - d2 = create_driver(conf1) - d2.expected_emits_length = 4 - d2.run + d2 = Fluent::Test::InputTestDriver.new(Fluent::Plugin::DummyInput).configure(conf1) + d2.run + d2.expected_emits_length = 4 first_id2 = d2.emits.first[2]['id'] - assert_equal 0, first_id2 + assert_equal d1.emits.length, first_id2 assert !File.exist?(File.join(TEST_PLUGIN_STORAGE_PATH, 'json', 'test-01.json')) end @@ -158,10 +158,10 @@ def create_driver(conf) test "value of auto increment key is suspended after stop-and-start" do assert !File.exist?(File.join(TEST_PLUGIN_STORAGE_PATH, 'json', 'test-02.json')) - d1 = create_driver(conf2) + d1 = Fluent::Test::InputTestDriver.new(Fluent::Plugin::DummyInput).configure(conf2) - d1.expected_emits_length = 4 d1.run + d1.expected_emits_length = 4 first_id1 = d1.emits.first[2]['id'] assert_equal 0, first_id1 @@ -171,9 +171,9 @@ def create_driver(conf) assert File.exist?(File.join(TEST_PLUGIN_STORAGE_PATH, 'json', 'test-02.json')) - d2 = create_driver(conf2) - d2.expected_emits_length = 4 + d2 = Fluent::Test::InputTestDriver.new(Fluent::Plugin::DummyInput).configure(conf2) d2.run + d2.expected_emits_length = 4 first_id2 = d2.emits.first[2]['id'] assert_equal last_id1 + 1, first_id2