Skip to content

Commit

Permalink
Add tests for NullFluentLogEventRouter
Browse files Browse the repository at this point in the history
Signed-off-by: Yuta Iwama <[email protected]>
  • Loading branch information
ganmacs committed Oct 29, 2019
1 parent 137f6b4 commit 65b7429
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/test_fluent_log_event_router.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 65b7429

Please sign in to comment.