Stack scope by variable and not by level

This commit is contained in:
Mike Angell
2019-08-28 04:25:26 +10:00
parent 250048717c
commit 3ef7eead27
6 changed files with 33 additions and 46 deletions
+2 -2
View File
@@ -369,7 +369,7 @@ HERE
end
def test_overwriting_internal_variable
template = <<-END_TEMPLATE
template = <<-HEREDOC
{% assign forloop = 'first' %}
{% for item in items %}
@@ -379,7 +379,7 @@ HERE
{% endfor %}
{{ forloop }}
END_TEMPLATE
HEREDOC
result = Liquid::Template.parse(template).render('items' => '1')
assert_equal 'Liquid::ForloopDrop Liquid::ForloopDrop second', result.split.map(&:strip).join(' ')