From 71477006a9954a458167fe694418bcf71be24e64 Mon Sep 17 00:00:00 2001 From: Nicklas Dohrn <20398358+nicklas-dohrn@users.noreply.github.com> Date: Wed, 21 Sep 2022 08:49:57 +0200 Subject: [PATCH 1/2] Add method for testing filtered_with_time This change allows plugin developers to test their filter_with_time plugins without sideloading a new test driver. Signed-off-by: Takuro Ashie --- lib/fluent/test/driver/filter.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/fluent/test/driver/filter.rb b/lib/fluent/test/driver/filter.rb index 0b8624857d..8d07e7810b 100644 --- a/lib/fluent/test/driver/filter.rb +++ b/lib/fluent/test/driver/filter.rb @@ -37,6 +37,10 @@ def filtered_records @filtered.map {|_time, record| record } end + def filtered_time + @filtered.map {|_time, record| _time } + end + def instance_hook_after_started super filter_hook = ->(time, record) { @filtered << [time, record] } From 899a0ca106538f058c448c12b1a12d68a4d580ec Mon Sep 17 00:00:00 2001 From: Takuro Ashie Date: Wed, 23 Nov 2022 20:14:19 +0900 Subject: [PATCH 2/2] Fix inappropriate `_` prefix usage for arguments Signed-off-by: Takuro Ashie --- lib/fluent/test/driver/filter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fluent/test/driver/filter.rb b/lib/fluent/test/driver/filter.rb index 8d07e7810b..0d6adb13da 100644 --- a/lib/fluent/test/driver/filter.rb +++ b/lib/fluent/test/driver/filter.rb @@ -38,7 +38,7 @@ def filtered_records end def filtered_time - @filtered.map {|_time, record| _time } + @filtered.map {|time, _record| time } end def instance_hook_after_started