From f5e77b6d1d66186be33610af52198082ce357173 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20S=C3=B8gaard?= Date: Fri, 10 Sep 2021 18:02:23 +0200 Subject: [PATCH] Update test to support third argument --- test/integration/standard_filter_test.rb | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/test/integration/standard_filter_test.rb b/test/integration/standard_filter_test.rb index f0f40226..701672fb 100644 --- a/test/integration/standard_filter_test.rb +++ b/test/integration/standard_filter_test.rb @@ -855,16 +855,20 @@ class StandardFiltersTest < Minitest::Test ["foo", 123, nil, true, false, Drop, ["foo"], { foo: "bar" }], ] test_types.each do |first| - test_types.each do |other| - (@filters.methods - Object.methods).each do |method| - arg_count = @filters.method(method).arity - arg_count *= -1 if arg_count < 0 - inputs = [first] - inputs << ([other] * (arg_count - 1)) if arg_count > 1 - begin - @filters.send(method, *inputs) - rescue Liquid::ArgumentError, Liquid::ZeroDivisionError - nil + test_types.each do |second| + test_types.each do |third| + (@filters.methods - Object.methods).each do |method| + arg_count = @filters.method(method).arity + arg_count *= -1 if arg_count < 0 + inputs = [first] + inputs << ([second] * (arg_count - 1)) if arg_count > 1 + inputs << ([third] * (arg_count - 1)) if arg_count > 2 + + begin + @filters.send(method, *inputs) + rescue Liquid::ArgumentError, Liquid::ZeroDivisionError + nil + end end end end