Fix assert_template_result tests not picking up Liquid::Environment.default.error_mode

The `rake test` command gave us the impression that we were running all the tests
on all the error modes, that was false.
This commit is contained in:
Charles-P. Clermont
2025-10-27 16:33:31 +01:00
committed by Guilherme Carreiro
parent 1be1e36a8d
commit 34ab3bdc8e
5 changed files with 15 additions and 7 deletions
+7 -2
View File
@@ -26,8 +26,12 @@ class ExpressionTest < Minitest::Test
def test_float
assert_template_result("-17.42", "{{ -17.42 }}")
assert_template_result("2.5", "{{ 2.5 }}")
assert_expression_result(0.0, "0.....5")
assert_expression_result(0.0, "-0..1")
with_error_mode(:lax) do
assert_expression_result(0.0, "0.....5")
assert_expression_result(0.0, "-0..1")
end
assert_expression_result(1.5, "1.5")
# this is a unfortunate quirky behavior of Liquid
@@ -61,6 +65,7 @@ class ExpressionTest < Minitest::Test
assert_template_result(
"",
"{{ - 'theme.css' - }}",
error_mode: :lax,
)
end