add regression tests for #377

This commit is contained in:
Florian Weingarten
2014-07-08 14:47:39 +00:00
parent 51c708c8f8
commit 8909c9f27a
2 changed files with 18 additions and 0 deletions
+10
View File
@@ -20,4 +20,14 @@ class ContextTest < Test::Unit::TestCase
assert_equal 'Global test', Template.parse("{{'test' | notice }}").render!
assert_equal 'Local test', Template.parse("{{'test' | notice }}").render!({}, :filters => [local])
end
def test_has_key_will_not_add_an_error_for_missing_keys
Template.error_mode = :strict
context = Context.new
context.has_key?('unknown')
assert_empty context.errors
end
end
@@ -205,4 +205,12 @@ class IncludeTagTest < Test::Unit::TestCase
Liquid::Template.tags['include'] = original_tag
end
end
def test_does_not_add_error_in_strict_mode_for_missing_variable
Liquid::Template.file_system = TestFileSystem.new
a = Liquid::Template.parse(' {% include "nested_template" %}')
a.render!
assert_empty a.errors
end
end # IncludeTagTest