Merge pull request #412 from Shopify/assign-strict

Pass through options on assign tag
This commit is contained in:
Tristan Hume
2014-08-11 15:37:49 -04:00
2 changed files with 12 additions and 1 deletions

View File

@@ -15,7 +15,7 @@ module Liquid
super
if markup =~ Syntax
@to = $1
@from = Variable.new($2)
@from = Variable.new($2,options)
else
raise SyntaxError.new options[:locale].t("errors.syntax.assign".freeze)
end

View File

@@ -24,4 +24,15 @@ class AssignTest < Minitest::Test
'{% assign foo not values %}.',
'values' => "foo,bar,baz")
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
end
end # AssignTest