From 077bf2a409b91601ec4fc88706cb3609060f7797 Mon Sep 17 00:00:00 2001 From: Dylan Thacker-Smith Date: Thu, 8 Oct 2020 11:55:40 -0400 Subject: [PATCH] Test reporting of liquid error for filter call with wrong number of arguments (#1311) --- test/integration/filter_test.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/integration/filter_test.rb b/test/integration/filter_test.rb index 7a35f16..3ad629c 100644 --- a/test/integration/filter_test.rb +++ b/test/integration/filter_test.rb @@ -153,6 +153,15 @@ class FiltersTest < Minitest::Test # tap still treated as a non-existent filter assert_equal("1000", Template.parse("{{var | tap}}").render!('var' => 1000)) end + + def test_liquid_argument_error + source = "{{ '' | size: 'too many args' }}" + exc = assert_raises(Liquid::ArgumentError) do + Template.parse(source).render! + end + assert_match(/\ALiquid error: wrong number of arguments /, exc.message) + assert_equal(exc.message, Template.parse(source).render) + end end class FiltersInTemplate < Minitest::Test