Fix case where a variable name is falsy

This commit is contained in:
Justin Li
2014-10-21 12:09:26 -04:00
parent d9ae36ec40
commit dedd1d3dc0
3 changed files with 3 additions and 1 deletions
@@ -8,6 +8,7 @@ class IfElseTagTest < Minitest::Test
assert_template_result(' this text should go into the output ',
' {% if true %} this text should go into the output {% endif %} ')
assert_template_result(' you rock ?','{% if false %} you suck {% endif %} {% if true %} you rock {% endif %}?')
assert_template_result(' NO ','{% assign v = false %}{% if v %} YES {% else %} NO {% endif %}')
end
def test_if_else
+1
View File
@@ -31,6 +31,7 @@ class VariableTest < Minitest::Test
def test_false_renders_as_false
assert_equal 'false', Template.parse("{{ foo }}").render!('foo' => false)
assert_equal 'false', Template.parse("{{ false }}").render!
end
def test_preset_assigns