Use VariableSignature as Syntax for Capture tag to allow hyphens in variable names

This commit is contained in:
Florian Weingarten
2015-01-09 14:15:26 +00:00
parent 4b0a7c5d1d
commit 7cfee1616a
3 changed files with 21 additions and 1 deletions
+10
View File
@@ -3,6 +3,16 @@ require 'test_helper'
class AssignTest < Minitest::Test
include Liquid
def test_assign_with_hyphen_in_variable_name
template_source = <<-END_TEMPLATE
{% assign this-thing = 'Print this-thing' %}
{{ this-thing }}
END_TEMPLATE
template = Template.parse(template_source)
rendered = template.render!
assert_equal "Print this-thing", rendered.strip
end
def test_assigned_variable
assert_template_result('.foo.',
'{% assign foo = values %}.{{ foo[0] }}.',