From 65b7429c03cc7fc9eead11a506338d9859c44f5e Mon Sep 17 00:00:00 2001 From: Yuta Iwama Date: Tue, 29 Oct 2019 10:52:22 +0900 Subject: [PATCH] Add tests for NullFluentLogEventRouter Signed-off-by: Yuta Iwama --- test/test_fluent_log_event_router.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/test_fluent_log_event_router.rb b/test/test_fluent_log_event_router.rb index 8102794d0c..5a70cf2cca 100644 --- a/test/test_fluent_log_event_router.rb +++ b/test/test_fluent_log_event_router.rb @@ -9,6 +9,17 @@ def build_config(config) Fluent::Config.parse(config, 'fluent_log_event', '', syntax: :v1) end + sub_test_case 'NullFluentLogEventRouter does nothing' do + test 'emittable? returns false but others does nothing' do + null_event_router = Fluent::NullFluentLogEventRouter.new + null_event_router.start + null_event_router.stop + null_event_router.graceful_stop + null_event_router.emit_event(nil) + assert_false null_event_router.emittable? + end + end + sub_test_case '#build' do test 'NullFluentLogEventRouter if root_agent have not internal logger' do root_agent = Fluent::RootAgent.new(log: $log, system_config: Fluent::SystemConfig.new)