mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-18 18:30:40 -07:00
Rename with_error_mode(...) to with_error_modes(...)
This commit is contained in:
committed by
Guilherme Carreiro
parent
d63dd104de
commit
6aa4041c0f
@@ -20,11 +20,11 @@ class CaseTagUnitTest < Minitest::Test
|
||||
{%- endcase -%}
|
||||
LIQUID
|
||||
|
||||
with_error_mode(:lax, :strict) do
|
||||
with_error_modes(:lax, :strict) do
|
||||
assert_template_result("one", template)
|
||||
end
|
||||
|
||||
with_error_mode(:rigid) do
|
||||
with_error_modes(:rigid) do
|
||||
error = assert_raises(Liquid::SyntaxError) { Template.parse(template) }
|
||||
|
||||
assert_match(/Expected end_of_string but found/, error.message)
|
||||
@@ -41,11 +41,11 @@ class CaseTagUnitTest < Minitest::Test
|
||||
{%- endcase -%}
|
||||
LIQUID
|
||||
|
||||
with_error_mode(:lax, :strict) do
|
||||
with_error_modes(:lax, :strict) do
|
||||
assert_template_result("one", template)
|
||||
end
|
||||
|
||||
with_error_mode(:rigid) do
|
||||
with_error_modes(:rigid) do
|
||||
error = assert_raises(Liquid::SyntaxError) { Template.parse(template) }
|
||||
|
||||
assert_match(/Expected end_of_string but found/, error.message)
|
||||
@@ -62,7 +62,7 @@ class CaseTagUnitTest < Minitest::Test
|
||||
{%- endcase -%}
|
||||
LIQUID
|
||||
|
||||
with_error_mode(:lax, :strict, :rigid) do
|
||||
with_error_modes(:lax, :strict, :rigid) do
|
||||
assert_template_result("one", template)
|
||||
end
|
||||
end
|
||||
@@ -77,7 +77,7 @@ class CaseTagUnitTest < Minitest::Test
|
||||
{%- endcase -%}
|
||||
LIQUID
|
||||
|
||||
with_error_mode(:lax, :strict, :rigid) do
|
||||
with_error_modes(:lax, :strict, :rigid) do
|
||||
assert_template_result("one", template)
|
||||
end
|
||||
end
|
||||
@@ -93,11 +93,11 @@ class CaseTagUnitTest < Minitest::Test
|
||||
LIQUID
|
||||
assigns = { 'foo' => { 'bar' => 'baz' } }
|
||||
|
||||
with_error_mode(:lax, :strict) do
|
||||
with_error_modes(:lax, :strict) do
|
||||
assert_template_result("one", template, assigns)
|
||||
end
|
||||
|
||||
with_error_mode(:rigid) do
|
||||
with_error_modes(:rigid) do
|
||||
error = assert_raises(Liquid::SyntaxError) { Template.parse(template) }
|
||||
|
||||
assert_match(/Unexpected character =/, error.message)
|
||||
@@ -115,11 +115,11 @@ class CaseTagUnitTest < Minitest::Test
|
||||
LIQUID
|
||||
assigns = { 'foo' => { 'bar' => 'baz' } }
|
||||
|
||||
with_error_mode(:lax, :strict) do
|
||||
with_error_modes(:lax, :strict) do
|
||||
assert_template_result("one", template, assigns)
|
||||
end
|
||||
|
||||
with_error_mode(:rigid) do
|
||||
with_error_modes(:rigid) do
|
||||
error = assert_raises(Liquid::SyntaxError) { Template.parse(template) }
|
||||
|
||||
assert_match(/Unexpected character =/, error.message)
|
||||
|
||||
@@ -108,7 +108,7 @@ class VariableUnitTest < Minitest::Test
|
||||
assert_equal(VariableLookup.new('foo-bar'), create_variable('foo-bar').name)
|
||||
assert_equal(VariableLookup.new('foo-bar-2'), create_variable('foo-bar-2').name)
|
||||
|
||||
with_error_mode(:strict) do
|
||||
with_error_modes(:strict) do
|
||||
assert_raises(Liquid::SyntaxError) { create_variable('foo - bar') }
|
||||
assert_raises(Liquid::SyntaxError) { create_variable('-foo') }
|
||||
assert_raises(Liquid::SyntaxError) { create_variable('2foo') }
|
||||
@@ -154,7 +154,7 @@ class VariableUnitTest < Minitest::Test
|
||||
end
|
||||
|
||||
def test_strict_filter_argument_parsing
|
||||
with_error_mode(:strict) do
|
||||
with_error_modes(:strict) do
|
||||
assert_raises(SyntaxError) do
|
||||
create_variable(%( number_of_comments | pluralize: 'comment': 'comments' ))
|
||||
end
|
||||
@@ -162,7 +162,7 @@ class VariableUnitTest < Minitest::Test
|
||||
end
|
||||
|
||||
def test_rigid_filter_argument_parsing
|
||||
with_error_mode(:rigid) do
|
||||
with_error_modes(:rigid) do
|
||||
# optional colon
|
||||
var = create_variable(%(n | f1 | f2:))
|
||||
assert_equal([['f1', []], ['f2', []]], var.filters)
|
||||
|
||||
Reference in New Issue
Block a user