mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-15 08:50:45 -07:00
Rename with_error_mode(...) to with_error_modes(...)
This commit is contained in:
committed by
Guilherme Carreiro
parent
d63dd104de
commit
6aa4041c0f
@@ -213,12 +213,12 @@ class VariableTest < Minitest::Test
|
||||
def test_filter_with_single_trailing_comma
|
||||
template = '{{ "hello" | append: "world", }}'
|
||||
|
||||
with_error_mode(:strict) do
|
||||
with_error_modes(:strict) do
|
||||
error = assert_raises(Liquid::SyntaxError) { Template.parse(template) }
|
||||
assert_match(/is not a valid expression/, error.message)
|
||||
end
|
||||
|
||||
with_error_mode(:rigid) do
|
||||
with_error_modes(:rigid) do
|
||||
assert_template_result('helloworld', template)
|
||||
end
|
||||
end
|
||||
@@ -226,12 +226,12 @@ class VariableTest < Minitest::Test
|
||||
def test_multiple_filters_with_trailing_commas
|
||||
template = '{{ "hello" | append: "1", | append: "2", }}'
|
||||
|
||||
with_error_mode(:strict) do
|
||||
with_error_modes(:strict) do
|
||||
error = assert_raises(Liquid::SyntaxError) { Template.parse(template) }
|
||||
assert_match(/is not a valid expression/, error.message)
|
||||
end
|
||||
|
||||
with_error_mode(:rigid) do
|
||||
with_error_modes(:rigid) do
|
||||
assert_template_result('hello12', template)
|
||||
end
|
||||
end
|
||||
@@ -239,12 +239,12 @@ class VariableTest < Minitest::Test
|
||||
def test_filter_with_colon_but_no_arguments
|
||||
template = '{{ "test" | upcase: }}'
|
||||
|
||||
with_error_mode(:strict) do
|
||||
with_error_modes(:strict) do
|
||||
error = assert_raises(Liquid::SyntaxError) { Template.parse(template) }
|
||||
assert_match(/is not a valid expression/, error.message)
|
||||
end
|
||||
|
||||
with_error_mode(:rigid) do
|
||||
with_error_modes(:rigid) do
|
||||
assert_template_result('TEST', template)
|
||||
end
|
||||
end
|
||||
@@ -252,12 +252,12 @@ class VariableTest < Minitest::Test
|
||||
def test_filter_chain_with_colon_no_args
|
||||
template = '{{ "test" | append: "x" | upcase: }}'
|
||||
|
||||
with_error_mode(:strict) do
|
||||
with_error_modes(:strict) do
|
||||
error = assert_raises(Liquid::SyntaxError) { Template.parse(template) }
|
||||
assert_match(/is not a valid expression/, error.message)
|
||||
end
|
||||
|
||||
with_error_mode(:rigid) do
|
||||
with_error_modes(:rigid) do
|
||||
assert_template_result('TESTX', template)
|
||||
end
|
||||
end
|
||||
@@ -265,12 +265,12 @@ class VariableTest < Minitest::Test
|
||||
def test_combining_trailing_comma_and_empty_args
|
||||
template = '{{ "test" | append: "x", | upcase: }}'
|
||||
|
||||
with_error_mode(:strict) do
|
||||
with_error_modes(:strict) do
|
||||
error = assert_raises(Liquid::SyntaxError) { Template.parse(template) }
|
||||
assert_match(/is not a valid expression/, error.message)
|
||||
end
|
||||
|
||||
with_error_mode(:rigid) do
|
||||
with_error_modes(:rigid) do
|
||||
assert_template_result('TESTX', template)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user