Remove {% local %} tag

This commit is contained in:
Justin Li
2019-04-08 18:34:39 -04:00
parent 8d1cd41453
commit 951abb67ee
3 changed files with 3 additions and 47 deletions

View File

@@ -21,16 +21,17 @@ class LiquidTagTest < Minitest::Test
-%}
LIQUID
assert_template_result('4 8 12', <<~LIQUID, 'array' => [1, 2, 3])
assert_template_result('4 8 12 6', <<~LIQUID, 'array' => [1, 2, 3])
{%- liquid
for value in array
local double_value = value | times: 2
assign double_value = value | times: 2
echo double_value | times: 2
unless forloop.last
echo " "
endunless
endfor
echo " "
echo double_value
-%}
LIQUID

View File

@@ -1,15 +0,0 @@
require 'test_helper'
class LocalTest < Minitest::Test
include Liquid
def test_local_is_scope_aware
assert_template_result('value', <<~LIQUID)
{%- if true -%}
{%- local variable-name = 'value' -%}
{{- variable-name -}}
{%- endif -%}
{{- variable-name -}}
LIQUID
end
end