blank and empty as variable names

This commit is contained in:
Florian Weingarten
2015-06-04 12:30:50 -04:00
parent c319240174
commit 4c22cef341
4 changed files with 31 additions and 9 deletions

View File

@@ -24,6 +24,16 @@ class VariableTest < Minitest::Test
assert_equal '', template.render!
end
def test_using_blank_as_variable_name
template = Template.parse("{% assign foo = blank %}{{ foo }}")
assert_equal '', template.render!
end
def test_using_empty_as_variable_name
template = Template.parse("{% assign foo = empty %}{{ foo }}")
assert_equal '', template.render!
end
def test_hash_scoping
template = Template.parse(%({{ test.test }}))
assert_equal 'worked', template.render!('test' => { 'test' => 'worked' })