diff --git a/test/plugin/test_filter_parser.rb b/test/plugin/test_filter_parser.rb
index 45df597400..3b538798b6 100644
--- a/test/plugin/test_filter_parser.rb
+++ b/test/plugin/test_filter_parser.rb
@@ -2,11 +2,8 @@
require 'timecop'
require 'fluent/test/driver/filter'
require 'fluent/plugin/filter_parser'
-require 'flexmock/test_unit'
class ParserFilterTest < Test::Unit::TestCase
- include FlexMock::TestCase
-
def setup
Fluent::Test.setup
@tag = 'test'
@@ -538,194 +535,290 @@ def test_time_should_be_reserved(conf)
assert_equal t, filtered[2][0]
end
- CONFIG_INVALID_TIME_VALUE = %[
- key_name data
-
- @type json
-
- ] # 'time' is implicit @time_key
- def test_filter_invalid_time_data
- # should not raise errors
- time = Time.now.to_i
- d = create_driver(CONFIG_INVALID_TIME_VALUE)
- assert_nothing_raised {
- d.run(default_tag: @tag) do
- d.feed(time, {'data' => '{"time":[], "f1":"v1"}'})
- d.feed(time, {'data' => '{"time":"thisisnottime", "f1":"v1"}'})
+ sub_test_case "abnormal cases" do
+ module HashExcept
+ refine Hash do
+ def except(*keys)
+ reject do |key, _|
+ keys.include?(key)
+ end
+ end
end
- }
- filtered = d.filtered
- assert_equal 1, filtered.length
-
- assert_equal 0, filtered[0][0].to_i
- assert_equal 'v1', filtered[0][1]['f1']
- assert_equal nil, filtered[0][1]['time']
- end
-
- # REGEXP = /^(?[^ ]*) [^ ]* (?[^ ]*) \[(?