From 348c5e24367f8799405b211c6a7edd81ff36efbd Mon Sep 17 00:00:00 2001 From: Hiroshi Hatake Date: Wed, 18 May 2022 10:45:52 +0900 Subject: [PATCH] config: test: Assert parametrs at once in est/test_config.rb Co-authored-by: Takuro Ashie --- test/test_config.rb | 53 ++++++++++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 20 deletions(-) diff --git a/test/test_config.rb b/test/test_config.rb index 3616fc00b9..74b4dc5d7f 100644 --- a/test/test_config.rb +++ b/test/test_config.rb @@ -202,26 +202,39 @@ def test_included fluent_log_conf = label_conf.elements.first fluent_log_buffer_conf = fluent_log_conf.elements.first - assert_equal 'dummy', dummy_source_conf['@type'] - assert_equal 'tag.dummy', dummy_source_conf['tag'] - - assert_equal 'tcp', tcp_source_conf['@type'] - assert_equal 'tag.tcp', tcp_source_conf['tag'] - - assert_equal 'none', parse_tcp_conf['@type'] - assert_equal 'why.parse.section.doesnot.have.arg,huh', parse_tcp_conf.arg - - assert_equal 'stdout', match_conf['@type'] - assert_equal 'tag.*', match_conf.arg - - assert_equal 'null', fluent_log_conf['@type'] - assert_equal '**', fluent_log_conf.arg - - assert_equal '@FLUENT_LOG', label_conf.arg - - assert_equal 'memory', fluent_log_buffer_conf['@type'] - assert_equal 'interval', fluent_log_buffer_conf['flush_mode'] - assert_equal '1s', fluent_log_buffer_conf['flush_interval'] + assert_equal( + [ + 'dummy', + 'tag.dummy', + 'tcp', + 'tag.tcp', + 'none', + 'why.parse.section.doesnot.have.arg,huh', + 'stdout', + 'tag.*', + 'null', + '**', + '@FLUENT_LOG', + 'memory', + 'interval', + '1s', + ], + [ + dummy_source_conf['@type'], + dummy_source_conf['tag'], + tcp_source_conf['@type'], + tcp_source_conf['tag'], + parse_tcp_conf['@type'], + parse_tcp_conf.arg, + match_conf['@type'], + match_conf.arg, + fluent_log_conf['@type'], + fluent_log_conf.arg, + label_conf.arg, + fluent_log_buffer_conf['@type'], + fluent_log_buffer_conf['flush_mode'], + fluent_log_buffer_conf['flush_interval'], + ]) end def test_check_not_fetchd