From 3a64b3741f9bae1cf78abd4e21b5d528cae1d4c6 Mon Sep 17 00:00:00 2001 From: Dylan Thacker-Smith Date: Tue, 6 Sep 2022 16:43:16 -0400 Subject: [PATCH] Add sample usage of error_mode test helper option --- test/integration/assign_test.rb | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/test/integration/assign_test.rb b/test/integration/assign_test.rb index 07d91e76..ba795fbb 100644 --- a/test/integration/assign_test.rb +++ b/test/integration/assign_test.rb @@ -34,14 +34,9 @@ class AssignTest < Minitest::Test end def test_assign_uses_error_mode - with_error_mode(:strict) do - assert_raises(SyntaxError) do - Template.parse("{% assign foo = ('X' | downcase) %}") - end - end - with_error_mode(:lax) do - assert(Template.parse("{% assign foo = ('X' | downcase) %}")) - end + assert_match_syntax_error("Expected dotdot but found pipe in ", + "{% assign foo = ('X' | downcase) %}", error_mode: :strict) + assert_template_result("", "{% assign foo = ('X' | downcase) %}", error_mode: :lax) end def test_expression_with_whitespace_in_square_brackets